Comment

Comment by ComputerGuru

Condition variables were the POSIX equivalent to Win32’s WaitForMultipleObjects (and IOCP apis like it). Now both are available on Windows (and my library makes WFMO available on *nix/Linux/macOS).

Semaphores alone can’t mimic the same semantics (juggling between multiple, disparate locks/sync objects) without running into a possible race condition unless you have an API that can somehow wait on one of two or more semaphores to become available.

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton