jthreads on MacOS

We try to ensure that all of our tech can run comfortably on Windows, Mac & Linux. Most of our customers use Windows of course and all of our servers are Linux but in our experience it has generally been useful to think about our technology in a way that doesn’t tie it to a single platform.

There are some downsides, of course. One that we ran up against recently was the lack of jthreads on Mac or in the clang C++ libraries. Fortunately, Grumpfy had published the original concept code and we were able to polish it up a little, wrap some CI around it and use it as a quick polyfill for Mac. It might not be perfect but it passes all of our tests and is fit for our use-case.

Problem averted, thanks to people working in the open and publishing their ideas. If Apple ever implement jthreads, we can drop our polyfill and use the official implementation but in the meantime we can still use the functionality.

Repo: