LittleBookOfSemaphores
LittleBookOfSemaphores copied to clipboard
Concurrent Updates 1.5.2 Clarification Suggestion
Hi -
First off, thanks for making this fun book available!
In section 1.5.2 Concurrent updates, the thread of execution at machine level is shown with two steps:
1. temp = count
2. count = temp + 1
This is true for CISC processors that can operate directly on memory, but RISC processors I've worked with would break it down into three instructions, which together are called a read-modify-write operation.
So, Thread A would be
1. temp = count
2. temp = temp + 1
3. count = temp
which gives one more opportunity for another thread to slice in.
Cheers,
Jeff B.