
21 Apr
2008
21 Apr
'08
10:06 p.m.
Howard Hinnant:
I've so far only looked at your implementation for a few minutes. The lock-reduced version is tricky. It has been three years since I did this, but when I did, I needed 3 flags instead of your two. That may have been because I was guarding against max-readers and you're not, not sure yet.
Actually most implementations tend to work as intended without a check if the "writer" bit is adjacent to the "#readers" bits (overflowing the count sets the writer bit). This is not the case for my implementation though since I've managed to put the bits in the wrong order. :-)