cpp11-on-multicore
cpp11-on-multicore copied to clipboard
Various synchronization primitives for multithreaded applications in C++11.
As It mentiond in https://bugzilla.redhat.com/show_bug.cgi?id=2109065 ``` assert(oldStatus.readers == 0); newStatus = oldStatus; newStatus.writers--; waitToRead = oldStatus.waitToRead; if (waitToRead > 0) { newStatus.waitToRead = 0; newStatus.readers = waitToRead; } ``` This...
Reading through the code here, I noted the following implementation of `LightweightSemaphore::tryWait()`: https://github.com/preshing/cpp11-on-multicore/blob/41ac9c73dfa32e2fbc0af6668358092fafdfcae4/common/sema.h#L201 If I am not mistaken, it is possible for another thread to signal between the `load` and...
Hi :-) In case you're interested, I added support for timeouts to the LightweightSemaphore. The platform-specific code is thanks to some pull requests I had on my concurrent queue (a...
This is a bit of a mixed bag of a commit, so I totally understand if you don't want to merge it as-is. I figured I'd let you choose what...