4 ms·
Windows has had this one for a while.
by wbl 5y ago
Windows 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.