StackGrab

Lab 6 · Processes & threads

Blocked threads

Four threads wait on the database while the core sits idle. Then remove the wait and win the race.

Shown in slow motion · every number is real.

· ·

CPU busy · measured after this run

Throughput· · ·

Nothing measured yet

4 threads · Thread pool CPU waiting for database
T1
T2
T3
T4
Saturate the pool

Turn the traffic dial up to 100 req/s, then run the thread pool. Watch the CPU meter.

Four threads, one core, 10 ms of CPU then 80 ms waiting for the database. What is the throughput ceiling?

Design
About this model

Simplified: arrivals are random (Poisson); each request uses exactly 10 ms of CPU and 80 ms of I/O. A blocked thread holds its slot through both phases; an event loop releases the thread during I/O. The counter exercise is deterministic, and the CPU meter comes from the same simulated run as the throughput.