Sujet : Re: notifying from inside or outside
De : 643-408-1753 (at) *nospam* kylheku.com (Kaz Kylheku)
Groupes : comp.lang.cDate : 12. May 2025, 21:52:50
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <20250512133259.596@kylheku.com>
References : 1
User-Agent : slrn/pre1.0.4-9 (Linux)
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/txrCygnal: Cygwin Native Application Library: http://kylheku.com/cygnalMastodon: @Kazinator@mstdn.ca