[PATCH] Add c++2a binary_semaphore

Jonathan Wakely jwakely@redhat.com
Tue Feb 18 14:31:00 GMT 2020


On 18/02/20 14:48 +0100, Sebastian Huber wrote:
>Hello,
>
>On 18/02/2020 07:46, Thomas Rodgers wrote:
>>This patch adds the c++2a semaphore header and binary_semaphore type. The implementation is not complete, this patch is just to solicit initial feedback.
>
>how do you plan to implement the binary semaphores? For example, do 
>you want to add the binary semaphores to gthr.h or via a mutex and a 
>condition variable or via some futex stuff? I ask because I would like 
>to support this in RTEMS.

Futexes where possible.

Using POSIX semaphores might be a good alternative for the
std::counting_semaphore type, but for std::binary_semaphore we talked
about just using a spinlock based on std::atomic.



More information about the Libstdc++ mailing list