Price your future right. 60% off with code BLACKSCHOLES at USD checkout. Offer ends in 8d 09h 54m 25s8 days 9 hours 54 minutes 25 seconds.
Price your future right. 60% off with code BLACKSCHOLES at USD checkout. Offer ends in 8d 09h 54m 25s8 days 9 hours 54 minutes 25 seconds.

Sign in to watch this lesson
Races and Locks · 4:47
What a thread should do while it waits for a lock. Spinning wastes whole time slices when the holder is preempted, and a ticket lock with more threads than cores collapsed from microseconds to milliseconds per handoff on an 8-core Apple M3. We compare yield, sleeping locks (the wakeup/waiting race, Linux's futex and glibc's one-integer mutex, and macOS's analogue __ulock_wait/__ulock_wake measured here) and two-phase locks, then see why trading systems spin anyway on isolated cores.