4 ms·
https://lore.kernel.org/lkml/20200612185122.327860-1-andrealmeid@collabora.com https://lore.kernel.org/lkml/20200612185122.327860-1-andreal... goes over what fu
by __s 5y ago
https://lore.kernel.org/lkml/20200612185122.327860-1-andrealmeid@collabora.com https://lore.kernel.org/lkml/20200612185122.327860-1-andreal... goes over what futex2 introduces
- gpderetta 5y agoWhile futex_waitv is great, I would have also liked a futex_wakev.
- ot 5y agoAs an optimization? Would futex support in io_uring be enough? https://lwn.net/Articles/857835/ https://lwn.net/Articles/857835/
- gpderetta 5y agoPossibly yes! Edit: but I'm having a deja vu. Did we already have this conversation?!?
- ot 5y agoNot that I remember :) I went through that LKML thread and it looks like that particular patch isn't going anywhere, but given the general direction of supporting all syscalls in io_uring, I'm confident it will happen eventually. Support for wait, in particular, would be strictly more powerful than waitv: you could wait for futexes and IO (or any other completions) at the same time!
- gpderetta 5y agoIt would. On the other hand, I never had a need to wait for futexes and IO at the same time. If I need an internal wakeup while blocked on a poll call, I would use an eventfd. YMMV. In any case generalized support for all or most syscalls in io_uring can only be a good thing. Especially if we get eBPF support for chaining. I'm also quite excited for the new intel instruction to send IPIs from userspace. That would be great for non blocking io_uring.
- wbl 5y agoWindows has had this one for a while.
- gpderetta 5y agoThe windows equivalent of futex_wait is WaitOnAddress. I don't think it supports waiting on multiple addresses, but I'm not a WIN32 programmer.
- sumtechguy 5y agoYeah from the 10 mins I spent in the docs I do not think there is one baked in. You would probably have to roll your own. It would not be pretty. https://docs.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-waitonaddress https://docs.microsoft.com/en-us/windows/win32/api/synchapi/...
- wbl 5y agoWaitForMultipleObjects. And it isn't from the Windows heritage but from VMS.
- gpderetta 5y agoWFMO is equivalent to select. This is different.
- __s 5y agoRelevant that Valve is sponsoring this for Wine's benefit
- ww520 5y agoI don't think Windows has the equivalent of futex2, waiting on multiple addresses. WaitOnAddress() in Windows is the equivalent of futex, waiting on a single address. WaitForMultipleObjects() in Windows is for acquiring multiple locks, not for waiting on arbitrary addresses. The parameters to WaitForMultipleObjects() are mutex/semaphore/event/etc handles. When WaitForMultipleObjects() returns, the ownerships of the locks are actually acquired. E.g. for semaphore, the count is decremented by WaitForMultipleObjects(). Futex2 is more generic where it just waits on multiple arbitrary addresses. The locking is done separately.