I'm trying to port the spsc queue to use C11 thread and atomic and I encounter this comment:
https://github.com/mattiasgustavsson/libs/blob/main/thread.h#L1401
As far as I can tell, the current signal is already guarding against spurious wake up with a while loop:
https://github.com/mattiasgustavsson/libs/blob/main/thread.h#L970-L974
https://github.com/mattiasgustavsson/libs/blob/main/thread.h#L998-L1008
What else needs to be fixed?
Can this just be switched to if instead?
It saves one atomic load which doesn't seem to be much in the grand scheme of things but still it's something.
I'm trying to port the spsc queue to use C11 thread and atomic and I encounter this comment:
https://github.com/mattiasgustavsson/libs/blob/main/thread.h#L1401
As far as I can tell, the current signal is already guarding against spurious wake up with a while loop:
https://github.com/mattiasgustavsson/libs/blob/main/thread.h#L970-L974
https://github.com/mattiasgustavsson/libs/blob/main/thread.h#L998-L1008
What else needs to be fixed?
Can this just be switched to if instead?
It saves one atomic load which doesn't seem to be much in the grand scheme of things but still it's something.