4 ms·
Futex has nothing to do with WFMO. Futex is equivalent to keyed events. The linux equivalent of WFMO is select/poll/epoll.
by gpderetta 1y ago
Futex has nothing to do with WFMO. Futex is equivalent to keyed events.
The linux equivalent of WFMO is select/poll/epoll.
- jauntywundrkind 1y agoMaybe perhaps, but its not clear to me what makes you argue that, and it doesn't match up from what I've read. From the article: > People often describe the futex as, "Wait on memory address". That overlooks the notification side, but it’s a much more apt name, and why Windows’ name for this API (WaitOnAddress) is superior API naming (to be fair, they did have a decade to think about the name). The difference between an Address and an Object feels pretty abstract to me. The API surfaced otherwise feels extremely similar. So I'm not sure that there's a ton of ground to stand on for this distinction you are trying to draw. Your assertions could use some argumentation to back them up. From the Futex2 pull requests in 5.16: > Add a new sys_futex_waitv() syscall which allows to wait on multiple futexes. The main use case is emulating Windows' WaitForMultipleObjects which allows Wine to improve the performance of Windows Games.
- senderista 1y agoThere is a huge difference. The Unix equivalent of an NT kernel object is a file descriptor (or more accurately an open file object). A futex is just a 32-bit word anywhere in memory, hashed to a kernel wait queue on first use. It is much lighter-weight than a kernel file object.
- cyberax 1y agoNT handles are a bit more lightweight compared to file descriptors. Their values are not dense, so creating a new one doesn't require searching for the first available number.
- jlokier 1y agoPerhaps they meant to write WaitOnAddress, which is the same as a basic futex.
- gpderetta 1y agoyes, sorry, I meant WaitOnAddress. I thought they were also called keyed events (or at least that was the NT name) but I might be wrong.
- garaetjjte 1y agoKeyed event is older thing, somewhat similar but lacks value comparison.
- ape4 1y agoWaitOnAddress() allows 32 or 64 bit addresses. "[in] AddressSize The size of the value, in bytes. This parameter can be 1, 2, 4, or 8."
- senderista 1y agoThank god there's no Linus at MSFT to pointlessly veto 64-bit futex support.