call
start()
run()
โถ start()
โณ sleep(1s)
๐ wait for lock
โ release
๐ finish
โ Scheduler tick
โบ Reset
selected:
๐ฉโ๐ณ Cook-1
threads alive:
0
ยท on a core:
0
๐งโ๐ณ
NEW
hired
โบ
๐ง
RUNNABLE
on shift, queued
โบ
๐ณ
RUNNING
at the stove
โบ
โธ
BLOCKED ยท WAITING
stuck at the oven
โบ
๐
TERMINATED
shift over
๐ฉโ๐ณ
Cook-1
NEW
๐งโ๐ณ
Cook-2
NEW
๐ฅ core ร1
โ idle โ
ready queue
โ empty โ
Two cooks, one stove
Pick a cook, then hit
โถ start()
to put them on shift.
โธ
RUNNABLE means
ready
, not running โ only one thread per core, and the
scheduler
picks who.