Haiku’s (kernel) condition variables API: design and implementation

A few months after my contract with Haiku, Inc. began, I rewrote the implementation of the Haiku kernel’s condition variables (as opposed to our userspace condition variables, which are from POSIX.) As this new implementation has run in Haiku for over a year and shipped in the latest release with no sign of any remaining issues, I figured it is high time for a deep-dive on the API, its implementation history, and the design of the new implementation I wrote.

I expect this article will be of broader interest than just to Haiku’s community, because Haiku’s condition variables API has some notable (and powerful) features not found in those of other operating systems, and its implementation is thus likewise unique (at least, as far as I have been able to figure out.)

I’m currently working on a “state of Haiku” sort of article, and I’m incredibly impressed with just how stable, fast, full-featured, and usable Haiku has become on real hardware. I’ve always kept an eye on Haiku in virtual machines, but now I’m running it on real hard hardware – where it belongs – and it’s been an absolute joy.

The fact that waddlesplash managed to pull off this switch basically without any issues and with few people noticing, is further illustration the project’s in a good place.


  1. 2023-04-25 3:23 am
    • 2023-04-25 3:44 am
      • 2023-04-25 12:32 pm
      • 2023-04-25 12:47 pm
        • 2023-04-25 1:11 pm
          • 2023-04-26 6:23 am
          • 2023-04-27 3:00 pm
        • 2023-04-25 7:47 pm
    • 2023-04-25 12:46 pm
  2. 2023-04-25 7:29 am
  3. 2023-04-25 1:04 pm
    • 2023-04-27 2:56 pm
      • 2023-04-27 3:16 pm
  4. 2023-04-28 3:36 pm