Engineering Lab

UCT CSC2002 / 2023

The concurrent club

A graphical club simulation exploring admission, grid movement, shared counters and thread coordination.

JavaSwingAtomic variablesSynchronisation

UCT / COURSE CONTEXT / 2023

CSC2002S · Computer Science 2002

Concurrent programming, computer architecture and interface design, with Java and assembler practicals.

Science handbook · 2023
Actual source-built Swing club animation with a grid, bar and occupancy counters
Actual source-built Swing club animation with a grid, bar and occupancy counters

ENGINEERING PERSPECTIVE

Inside the work

Make shared-state coordination visible through a club simulation. Admission, occupied cells and counters reveal why synchronized access and liveness are separate concerns.

Java threads / atomic variables
Patrons move and update shared occupancy/counter state.
Swing
The original source-built grid, bar and controls display the evolving simulation.
STEP 1 / 3

Coordinate entry

Start/pause flags and admission conditions govern arriving patrons.

Source-derived walkthrough

How it works

Each patron has a thread and a grid location. Grid blocks coordinate occupancy, atomic counters track waiting/inside/left patrons, and Swing displays the changing grid. The main application exposes Start, Pause and Quit.

Results & recovery

  • Eight recovered Java classes compile with JDK 17.
  • The actual Swing interface was launched from a clean source copy during the 2026 recovery.

Technical limitations

Compilation and a screenshot do not establish deadlock freedom. Busy-wait loops and a notifyAll call without the matching monitor remain in the submitted source. The console Andre scheduler is a separate 2024 project.

What I would improve now

Use blocking admission primitives, review lock ownership and capacity check atomicity, add liveness tests and update Swing widgets on the event-dispatch thread.

NEXT IN THE ARCHIVEWords in motion