enjoying the updated edition! "The lock operation is more expensive than CAS because it requires two atomic operations on the lock data structure, one for acquisition and the other for release." this might be worth expanding upon. it's not immediately obvious to me why the unlock would need to be atomic. the rough 2x certainly jives with this explanation, and i intend to go look at some source, but i'd think it would be more: atomic update fence non-atomic update you've presumably got threads attempting to lock with a CAS looking for a sentinel representing unlocked, right? so if i update back to that sentinel in multiple steps, they're going to miss in media res, no? feel no obligation to respond, of course. --nick -- nick black -=- https://www.nick-black.com to make an apple pie from scratch, you need first invent a universe.
Attachment:
signature.asc
Description: PGP signature