Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.programming.threads > #1523

Re: Condition variable 2...

From Gerald Breuer <Gerald.Breuer@googlemail.com>
Newsgroups comp.programming.threads
Subject Re: Condition variable 2...
Date 2013-06-11 19:48 +0200
Organization Aioe.org NNTP Server
Message-ID <kp7nsq$6k1$1@speranza.aioe.org> (permalink)
References <kp7mcj$efu$1@dont-email.me>

Show all headers | View raw


Am 11.06.2013 22:27, schrieb aminer:
>
> how can i spin in a fast pathed condition variable
> using CAS without eating too much CPU and being efficient ?

Condition-Variables are used in producer-consumer-scenarios with using
queues. Pushing and popping elements from a qeue is usually by magnitu-
des faster than what's done to produce or consume elements from such
queues (otherwise you wouldn't push such elements to other threads).
That's the reason why there's almost none contention with queues pro-
tected by CVs and there's no need for spinning.
Spinning is done with mutexes which have a userland-part for uncon-
tended cases.

Back to comp.programming.threads | Previous | Next | Find similar


Thread

Re: Condition variable 2... Gerald Breuer <Gerald.Breuer@googlemail.com> - 2013-06-11 19:48 +0200

csiph-web