3 ms·
I wonder if they have considered implementing futexes in userland so they don't have to wait for the kernel implementing this. WebKit has its own implementatio
by ot 7y ago
I wonder if they have considered implementing futexes in userland so they don't have to wait for the kernel implementing this.
WebKit has its own implementation (see the ParkingLot in https://webkit.org/blog/6161/locking-in-webkit/ https://webkit.org/blog/6161/locking-in-webkit/) which inspired an implementation in folly (https://github.com/facebook/folly/blob/master/folly/synchronization/ParkingLot.h https://github.com/facebook/folly/blob/master/folly/synchron...).
Surprisingly, implementing futexes in userland can have performance benefits wrt kernel futexes (because of better control over the fast path, possibly avoiding syscalls) and a richer interface (for example the value doesn't need to be 32 bit, just any atomic).