Go runtime services and scheduling

R-SCHED-V4-2medium

Park handlers waiting on I/O

This deterministic authored scheduler represents web-service handlers; it is not the Go runtime algorithm or a native scheduling measurement. One line is request <name> <step> ... or run <processors>. Names match [A-Za-z_][A-Za-z0-9_]* and are unique per batch; steps are cpu or io<k> with integer k in 1..16 (no zero-duration I/O). Easy uses cpu only. Each run takes 1..8 processors, at most 12 requests and 32 steps per request, with total CPU steps plus all I/O durations at most 128 per batch. At most 128 commands and 8192 ASCII bytes per line; ordinary I/O/allocation completes. Empty requests and empty batches are supported. Finish each declared batch with run. Initial queues use declaration index modulo processor count. A tick first wakes waits in parking order, then visits processors in ascending order; each executes at most one cpu step. Completed waits do not requeue. Empty selected requests retire without a CPU step; a final wake tick can print idle. The supplied loop cap is 200 ticks, above the supported correct workload. A no-tick batch prints schedule: with no trailing space. These tick, wake, donor and home-queue rules are model contracts, not guaranteed real-Go scheduling.

What needs to change

Change startIo so a handler waiting on the database does not hold its processor.

Reproduce

  1. Run the sample: the C++ program reads cart (cpu io3 cpu) and pdf (4 cpu steps), then run 1. Compare the schedule.

Acceptance criteria

Your review marks · Saved in this browser. Test acceptance is tracked separately.

Notes

afterStep and pick are supplied. startIo receives the processor, the request, the parked list and the tick. The lab compiles with g++ -std=c++23.

Sign in to open this exercise

The ticket brief is public. Sign in to access the exercise. Paid exercises require Pro.

Sign in