Demo: Problems with Synchronization¶
granularity/--- one mutex, taken once per addition or once per thread.deadlock/--- two threads, two locks, opposite orders.toctou/--- a check and an update, each under the lock, and a wrong result.
granularity/ --- one mutex, taken once per addition or once per thread.deadlock/ --- two threads, two locks, opposite orders.toctou/ --- a check and an update, each under the lock, and a wrong result.