Sujet : Re: signalling a condvar from inside vs. signalling a condvar von outside
De : Bonita.Montero (at) *nospam* gmail.com (Bonita Montero)
Groupes : comp.lang.c++Date : 20. Apr 2025, 08:07:28
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vu26ec$39qj9$1@raubtier-asyl.eternal-september.org>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
User-Agent : Mozilla Thunderbird
Am 20.04.2025 um 07:49 schrieb Chris M. Thomasson:
Barf! Are you daft? Only broadcast when you need to and well, try to strive to do it outside of the locked region, when you can. wow. Daft Punk?
If I have just inserted N items in the queue and I have M waiting
threads and N >= M a broadcast is more efficient since you have
only one wakeup call and not not N.
This doesn't lead to more context-switches or coherency-traffic
as Scott mentioned.
I measured the number of context switches and the overall CPU
-time with Linux but you are only talking of things which are
not thought to the end.