Why doesn’t C++ compare_exchange allow stronger consistency for fail than success
I’ve got a lock-like structure that lets threads block until the exclusive lock is free. It’s not relevant to my question, but in case you are thinking “Just don’t do that,” the blocking is actually useful for two different derived classes: 1) traditional reader-writer locks wait for the exclusive lock to be released when attempting the shared lock (which inhibits further exclusive lockers), and 2) RCU-like reader locks allow coroutines to read shared data until they are suspended (because the exclusive lock waits for each thread in a thread pool to have passed through a quiescent period).
Why doesn’t C++ compare_exchange allow stronger consistency for fail than success
I’ve got a lock-like structure that lets threads block until the exclusive lock is free. It’s not relevant to my question, but in case you are thinking “Just don’t do that,” the blocking is actually useful for two different derived classes: 1) traditional reader-writer locks wait for the exclusive lock to be released when attempting the shared lock (which inhibits further exclusive lockers), and 2) RCU-like reader locks allow coroutines to read shared data until they are suspended (because the exclusive lock waits for each thread in a thread pool to have passed through a quiescent period).
Why doesn’t C++ compare_exchange allow stronger consistency for fail than success
I’ve got a lock-like structure that lets threads block until the exclusive lock is free. It’s not relevant to my question, but in case you are thinking “Just don’t do that,” the blocking is actually useful for two different derived classes: 1) traditional reader-writer locks wait for the exclusive lock to be released when attempting the shared lock (which inhibits further exclusive lockers), and 2) RCU-like reader locks allow coroutines to read shared data until they are suspended (because the exclusive lock waits for each thread in a thread pool to have passed through a quiescent period).
Why doesn’t C++ compare_exchange allow stronger consistency for fail than success
I’ve got a lock-like structure that lets threads block until the exclusive lock is free. It’s not relevant to my question, but in case you are thinking “Just don’t do that,” the blocking is actually useful for two different derived classes: 1) traditional reader-writer locks wait for the exclusive lock to be released when attempting the shared lock (which inhibits further exclusive lockers), and 2) RCU-like reader locks allow coroutines to read shared data until they are suspended (because the exclusive lock waits for each thread in a thread pool to have passed through a quiescent period).