Wait so it is apparently possible to construct a (lock-free) multiword CAS out of singleword ones?

Is this why GNU libatomic has a hard dependency on CAS primitives? :cirnothinking:

@koakuma without memory linear in the number of threads that could be involved?

@robryk But seems like the schemes I've read so far does involve a per-thread structure yes

@koakuma Actually, I think one can do with just one shared "buffer", at least in the world where you can fit a counter of operations in half of the CAS word -- while filling the buffer, which is composed of <prev version, word> pairs, you CAS its elements so that you start failing if there was an intervening update.

@robryk I wonder if a 2x32b CAS has enough space for the counter...

Follow

@koakuma thanks for an interesting problem to think about, which I hopefully will over the next week or so

Sign in to participate in the conversation
CleverLibre Social

CleverLibre Social is an inclusive social instance for open discussion, learning, and community.
All cultures welcome.
Hate speech and harassment strictly forbidden.