2 ms·
Futexes can be moved into user space! https://webkit.org/blog/6161/locking-in-webkit/ https://webkit.org/blog/6161/locking-in-webkit/
by senderista 1y ago
Futexes can be moved into user space!
https://webkit.org/blog/6161/locking-in-webkit/ https://webkit.org/blog/6161/locking-in-webkit/
- tialaramex 1y agoWhile I'm sure it sounds great to Apple fans, this ends up just being a circle in practice. We need a way to fall asleep when contended. Apple calls this a "Parking Lot" Linux calls it a "Futex" and as we've seen Microsoft have a different name. Like Microsoft's Apple's approach is slightly smaller (one byte not four) and over a decade later.
- gpderetta 1y agoWell, but with a parking_lot abstraction, you only need a wait primitive per thread (as a thread_local for example), so it doesn't need to be a futex. It could be a eventfd which is interesting for integrating with other event loops.
- senderista 1y agoBy putting the wait queues in userspace you can customize behavior with callbacks, as the article shows.