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


Groups > comp.programming.threads > #514 > unrolled thread

Comparison of various synchronization mechanisms?

Started byPapa Stratos <armadillodm@flashmail.com>
First post2011-08-16 18:20 -0700
Last post2011-08-24 12:49 +0200
Articles 4 — 2 participants

Back to article view | Back to comp.programming.threads


Contents

  Comparison of various synchronization mechanisms? Papa Stratos <armadillodm@flashmail.com> - 2011-08-16 18:20 -0700
    Re: Comparison of various synchronization mechanisms? Alexander Terekhov <terekhov@web.de> - 2011-08-17 16:09 +0200
      Re: Comparison of various synchronization mechanisms? Papa Stratos <armadillodm@flashmail.com> - 2011-08-20 17:06 -0700
        Re: Comparison of various synchronization mechanisms? Alexander Terekhov <terekhov@web.de> - 2011-08-24 12:49 +0200

#514 — Comparison of various synchronization mechanisms?

FromPapa Stratos <armadillodm@flashmail.com>
Date2011-08-16 18:20 -0700
SubjectComparison of various synchronization mechanisms?
Message-ID<0ddf3aed-90df-4cf0-ac3f-7ca6a07ae638@w11g2000vbp.googlegroups.com>
Hello,

Is anyone aware of a material (book or online) comparing or discusses
said synchronization mechanisms?  For instance, I am interested
knowing which would wake all waiting threads (thundering herd) versus
one waiting thread.  If it compares across platforms, the better.

Thanks,
a.

[toc] | [next] | [standalone]


#515

FromAlexander Terekhov <terekhov@web.de>
Date2011-08-17 16:09 +0200
Message-ID<4E4BCB80.6ECB7053@web.de>
In reply to#514
Papa Stratos wrote:
> 
> Hello,
> 
> Is anyone aware of a material (book or online) comparing or discusses
> said synchronization mechanisms?  For instance, I am interested
> knowing which would wake all waiting threads (thundering herd) versus
> one waiting thread.  If it compares across platforms, the better.

What is your real problem regarding (all/one) waiting thread(s), Papa?

Please explain.

regards,
alexander.

[toc] | [prev] | [next] | [standalone]


#520

FromPapa Stratos <armadillodm@flashmail.com>
Date2011-08-20 17:06 -0700
Message-ID<4ecbf8fd-1c82-4a9a-a1a0-334df616e5d5@d7g2000vbv.googlegroups.com>
In reply to#515
>
> What is your real problem regarding (all/one) waiting thread(s), Papa?

Right now, none really :) I am just trying to educate myself, knowing
which synchronization mechanisms to use when it happens to have
multiple threads waiting on the same lock.

For instance (http://pubs.opengroup.org/onlinepubs/009604499/functions/
pthread_cond_signal.html), pthread_cond_broadcast() is explicit about
waking all threads. pthread_cond_signal() states "at least one" which
may or may not create performance problems.

On the Windows side (http://msdn.microsoft.com/en-us/library/
ms682396%28v=vs.85%29.aspx), signalling an event would wake a single
thread.

Just curious if I can find a discussion on the subject anywhere.

Thanks,
a.

[toc] | [prev] | [next] | [standalone]


#524

FromAlexander Terekhov <terekhov@web.de>
Date2011-08-24 12:49 +0200
Message-ID<4E54D73A.285BA80B@web.de>
In reply to#520
Papa Stratos wrote:
> 
> >
> > What is your real problem regarding (all/one) waiting thread(s), Papa?
> 
> Right now, none really :) I am just trying to educate myself, knowing
> which synchronization mechanisms to use when it happens to have
> multiple threads waiting on the same lock.

Just use a proper type of lock. E.g. it really does make sense for
pthread_rwlock_unlock() to unlock multiple blocked readers vs only one
blocked writer depending on rwlock's policy (or lack thereof).

> 
> For instance (http://pubs.opengroup.org/onlinepubs/009604499/functions/
> pthread_cond_signal.html), pthread_cond_broadcast() is explicit about
> waking all threads. pthread_cond_signal() states "at least one" which
> may or may not create performance problems.
> 
> On the Windows side (http://msdn.microsoft.com/en-us/library/
> ms682396%28v=vs.85%29.aspx), signalling an event would wake a single
> thread.
> 
> Just curious if I can find a discussion on the subject anywhere.

There is plenty of discussion to be found on the net (including archives
of this newsgroup) on the topic of pros and cons regarding various types
of synchronization objects. Just do a (re)search.

regards,
alexander.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.programming.threads


csiph-web