5 ms·
Peterson's Algorithm isn't lock-free, it's a blocking one.
by bandwitch 12y ago
Peterson's Algorithm isn't lock-free, it's a blocking one.
- jberryman 12y agoHmm, are you sure that's correct? I believe both the qualities re. "progress" and "bounded waiting" here http://en.wikipedia.org/wiki/Peterson%27s_algorithm#Progress http://en.wikipedia.org/wiki/Peterson%27s_algorithm#Progress are enough to guarantee system-wide progress. Can you elaborate? Edit: Nevermind. So of course we'd need the critical section and thread-coordination mechanism to be a single atomic operation for this to be a lock-free algorithm. I should RTFA.
- virtue3 12y ago... if you look at the psuedo code the "busy wait" (with a busy while loop...) comment and "critical section" comment should also be very large flags to this being a blocking operation.