• Re: notifying from inside or outside

    From Kaz Kylheku@21:1/5 to Bonita Montero on Mon May 12 20:52:50 2025
    On 2025-05-09, Bonita Montero <Bonita.Montero@gmail.com> wrote:
    So for Windows it's the best to notify individually while holding the
    mutex.
    All tests are with 31 threads waiting for a notification and one thread
    which is notifying.

    When you hit a condition variable while holding the mutex, you're
    including, in the mutex's critical region, all those instructions needed
    to perform that operation, possibly requiring a trip to the kernel.

    There have to be conditions (no pun intended) under which that causes
    a problem; you're just not hitting them in your test case.

    --
    TXR Programming Language: http://nongnu.org/txr
    Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
    Mastodon: @Kazinator@mstdn.ca

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)