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

Sign in to watch this lesson
Races and Locks · 4:07
Two names that are easy to mix up. A race condition is any outcome that depends on thread timing, like a reader skipping a node while another thread is halfway through unlinking it; a data race is the Standard's precise rule (same memory location, a write, a non-atomic access, no ordering) and it is undefined behaviour. We catch data races with ThreadSanitizer on a plain counter and on two bit-fields that share one byte, then watch an atomic check-then-act oversell a seat while ThreadSanitizer stays silent.