Skip to content

Comment on Correctly implementing a spinlock in Modern C++

Comments

For a real battle-tested combination of spinlock and futex, see https://github.com/abseil/abseil-cpp/blob/master/absl/synchr...

Just pointing out: while this implementation is absolutely non- trivial to study, everytime I take a look at the abseil source, I am delighted with the quality of inline comments.

Well isn't that just a normal lock/mutex of the "lightweight" type (only enter kernel on contention)?

You cannot use that in non-preemptible context.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.