|
|
Subscribe / Log in / New account

Windows NT synchronization primitives for Linux

Windows NT synchronization primitives for Linux

Posted Feb 23, 2024 12:41 UTC (Fri) by nicklecompte (guest, #151334)
In reply to: Windows NT synchronization primitives for Linux by geofft
Parent article: Windows NT synchronization primitives for Linux

> (Also - why isn't the "pulse" operation just FUTEX_WAKE without actually writing to the futex location? I'm certainly missing something....)

I am actually more familiar with Windows events than futexes so excuse my heresy :) One problem I see is auto-reset events, where pulse specifically only wakes one *and only one* of the waiting threads. But I don't think futexes don't have an easy way of guaranteeing the wakes happen atomically in that fashion: it seems like this would wake *at least* one waiting thread, absent a very clever workaround or modifying the kernel directly. Of course I could be missing something. But I suspect Windows kernel being written to atomically wake up a single waiting thread is probably expensive to emulate on Linux.


to post comments

Windows NT synchronization primitives for Linux

Posted Feb 24, 2024 23:37 UTC (Sat) by itsmycpu (guest, #139639) [Link]

> I am actually more familiar with Windows events than futexes so excuse my heresy :) One problem I see is auto-reset events, where pulse specifically only wakes one *and only one* of the waiting threads. But I don't think futexes don't have an easy way of guaranteeing the wakes happen atomically in that fashion: it seems like this would wake *at least* one waiting thread, absent a very clever workaround or modifying the kernel directly. Of course I could be missing something. But I suspect Windows kernel being written to atomically wake up a single waiting thread is probably expensive to emulate on Linux.

Futexes do have an easy way to wake exactly one thread (of course, otherwise how would you efficiently implement a lock using them).


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds