Apologies, Gilbert & Sullivan
I am the very model of a modern Counting Semaphore.
Permits acquired and then released are what APIs are for.
My blocking calls may throw ‘less they’re made uninterruptibly.
My docs say that I’m good for all your basic synchronicitity.
Starving threads may be prevented when my fairness flag is set.
But calls to all my locking methods might suffer a bit with that.
If you really need that much performance, then that’s what spinlocks are for.
I’m just the very model of a modern Counting Semaphore!
(Originally posted on Mastodon.)