SYSTEMS / UCT · CSC3002 / 2024
OS scheduling: Andre the Barman
Explore queue policy, thread coordination and measurement validity through FCFS/SJF service simulation and a separate address translator.
UCT / COURSE CONTEXT / 2024
CSC3002F · Computer Science 3002
Operating-system organisation and computer networks, with an Internet-protocol focus.
2026 PORTFOLIO RECREATIONS
Andre's BarENGINEERING PERSPECTIVE
Inside the work
Make scheduling policy and measurement design concrete: competing requests enter a queue, but a meaningful comparison also requires correct arrival, first-service and completion timestamps.
- Java / blocking queues
- LinkedBlockingQueue and PriorityBlockingQueue express FCFS and SJF service choices.
- CountDownLatch / threads
- Coordinate the start and service lifecycle of patron requests.
Submit requests
Patron threads create orders after a coordinated start.
- Policy vs mechanism
- Queue ordering selects work; threads, blocking and completion signals implement service coordination.
- Timing definitions
- Response, waiting and turnaround use per-request boundaries, not a shared simulation start.
- Fair comparison
- Policies need the same workload. SJF starvation is a theoretical risk, not a measured result in these recovered runs.
What the demonstration establishes
The browser scheduling model uses an explicit synthetic workload. Original Java smoke runs completed, but missing arrival initialization and global timing boundaries invalidate its aggregate benchmarks.
Evidence behind this page
Named scheduling reports and privately preserved teaching source; claimed superior averages are not promoted over timing defects. The public individual translator separately passes eight synthetic translations and three invalid-record checks; no teaching scheduler is released.
What it is
Explore the behaviour of scheduler policies in a concurrent service simulation and map virtual addresses to physical frames using a fixed page table.
Why it was built
Compare queue policies under competing requests and separately understand how a page-table mapping translates addresses.
My contribution
Individual named address translator; scheduling coursework on attributed teaching scaffolding remains private. The console programme identifies Andre the Barman; the Swing club simulation is a different 2023 assignment.
How it works
Patron and service threads coordinate with CountDownLatch. FIFO and priority queues support FCFS/SJF policies; timing outputs capture wait, response and turnaround behaviour. A separate memory exercise decodes little-endian addresses.
- 01Concurrent requests
- 02FIFO / priority queue
- 03FCFS / SJF service
- 04Timing outputs
Technical implementation
- Patron threads submit DrinkOrder objects to a BlockingQueue. FCFS uses LinkedBlockingQueue; SJF uses PriorityBlockingQueue with the order comparison.
- A CountDownLatch coordinates the initial start. The barman thread takes orders, sleeps for their service duration and signals completion.
- Private three-patron runs under each policy completed on JDK 17. They exposed invalid aggregate timing calculations, which remain disclosed rather than treated as benchmarks.
- The public OS1 translator decodes little-endian eight-byte records using a fixed seven-entry page table and a seven-bit offset. Labelled later changes reject truncated/out-of-range records; eight synthetic translations and three invalid-record checks passed on 13 October 2026.
Compare the scheduling policies
Synthetic demonstration requests, arbitrary time units. A new scheduling visualisation, not historical measurements. Response equals waiting here because service is non-preemptive. The original Andre simulation's invalid timing aggregates remain disclosed.
Address translation
FIXED PAGE TABLE / 128-BYTE PAGES
Inside an address.
Virtual 68 → physical 324 / 0x144
000OFFSET / 7 BITS1000100010SAME OFFSET1000100page = address >> 7
offset = address & 127
physical = (table[page] << 7) + offsetNew binary explorer using the exact fixed table and bit operations in OS1Assignment.java. Seven valid virtual pages; no page replacement, faults or measured memory latency.
Results & evidence
- Private scheduling source compiled with JDK 17; both three-patron FCFS/SJF smoke runs completed.
- The original address translator reproduced eight physical addresses from the private supplied fixture.
- The public translator passed eight authored synthetic translations and three invalid-record checks on 13 October 2026; both stdout and file output were verified.
Engineering challenges
A runnable simulation is not necessarily a valid measurement system. Arrival-time initialisation and per-order timing boundaries are as important as queue choice.
Scope & limitations
Fresh runs expose an invalid turnaround aggregate: the order arrival field is not populated, and waiting/response aggregates use the global service start rather than each order arrival. These are not valid scheduler benchmarks. Teaching scaffolding is attributed.
What I learned
Blocking queues, barriers and service coordination, plus how to audit measurements against their definitions.
What I would improve now
Fix per-order timestamps in a new scheduling experiment and reuse identical workloads across policies. Extend translator stream/alias-path tests and write output atomically so a failed run cannot leave partial results.