P3L4: Synchronization Constructs Flashcards
1
Q
- Synchronization Constructs Visual Metaphor
A
2
Q
difference between mutex and spinlock
A
The fundamental difference between spinlock and mutex is that spinlock keeps checking the lock (busy waiting), while mutex puts threads waiting for the lock into sleep (blocked). A busy-waiting thread wastes CPU cycles, while a blocked thread does not.
https://attractivechaos.wordpress.com/2011/10/06/multi-threaded-programming-efficiency-of-locking/
3
Q
Spinlocks
A
4
Q
High contention
A
The processor go to memory on each spin
5
Q
- Cache Coherence
A
6
Q
- Spinlock Delay Alternatives
A
7
Q
what problem they’re setting up
A
8
Q
and how they approach it
A