logoalt Hacker News

danbructoday at 1:00 PM2 repliesview on HN

A common approach to mitigating the described data race without using blocking locks is to utilize a sequence lock.

A sequence lock is a blocking lock. If the writer dies between the two increment operations, then the readers will spin forever waiting for the counter to become even again.


Replies

rbransontoday at 2:20 PM

This is why wait-free and lock-free are separate concepts. Author is not claiming wait-free.

show 2 replies
jnwatsontoday at 1:58 PM

Also, there's no guarantee of progress. The writer can starve the reader forever.

show 2 replies