Hacker News new | ask | show | jobs
by Upvoter33 1491 days ago
Interesting to look through.

I quickly scanned for things that stood out for me. As with anything, there are some things I disagree with.

To wit: the condition variable code includes a mutex inside of it, to deal with the case where you perform a signal on something before there is a waiter. Does this solve some problems? Sure. But it introduces extra overhead when I know what I'm doing and just want a condition variable.

These types of small things - the author thinks this is the "right thing", whereas others won't - are why no C standard C library like this exists. In C, the beauty is that you make every single decision; someone else's decisions won't be the same as yours.

1 comments

Condition variables must always be used with mutexes.