3 ms·
This seems pretty inherently difficult to port or to run safely. Things like fuetxes will only work directly on Linux and OpenBSD, for example. From what I reca
by ori_b 3y ago
This seems pretty inherently difficult to port or to run safely. Things like fuetxes will only work directly on Linux and OpenBSD, for example. From what I recall, OSX has some undocumented futex-like-but-not-quite ulock, and FreeBSD has yet another incompatible tool.
Fork is not a windows-native primitive, and while cygwin may have implemented emulation, the performance sucks. Pthreads is in a similar situation.
So, given that this will mainly target linux well, I'm not sure what advantages it brings over native code. It mostly feels like native code with extra steps.
- tyingq 3y agoThis seemed like a reasonable overview of "futex-like" functionality on things other than Linux: https://shift.click/blog/futex-like-apis/ https://shift.click/blog/futex-like-apis/ As you say, it's not straightforward.
- ComputerGuru 3y agoWTF locks under C++ and Parking Lot under rust are great low level futex-esque cross-platform abstractions/implementations. They originate from the WebKit codebase (unless it was Blink but I think they predate the fork). They run under Windows, Linux, the various BSDs, and macOS.