comp.lang.ada
 help / color / mirror / Atom feed
From: Maciej Sobczak <see.my.homepage@gmail.com>
Subject: Re: C++ primer on multithreading
Date: Wed, 20 Apr 2011 13:44:31 -0700 (PDT)
Date: 2011-04-20T13:44:31-07:00	[thread overview]
Message-ID: <fcb4f271-3a0f-4764-bbf3-db3f9c15bb4b@z31g2000vbs.googlegroups.com> (raw)
In-Reply-To: iomlk6$hii$1@dont-email.me

On Apr 20, 3:04 pm, "Alex R. Mosteo" <alejan...@mosteo.invalid> wrote:

> Basically I need a protected queue with blocking semantics; several
> writters, one consumer.

This is easy to implement and for the above you will need only one
mutex and one condvar.

This is what I have quickly found on Google:

http://www.quantnet.com/cplusplus-multithreading-boost/

See especially 18.11, but I guess the whole page is worth reading.

> Also more generally, I wondered too if there's some ready-to-use protected
> stuff in C++ that spares me dealing with mutexes to emulate a synchronized
> interface.

No and the (current) C++ culture is that this stuff is supported by
libraries, not by language. As you see with the code on the above
page, it might not be as elegant as in Ada, but still not that
terribly difficult to grasp.

--
Maciej Sobczak * http://www.msobczak.com * http://www.inspirel.com



  parent reply	other threads:[~2011-04-20 20:44 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-20 10:45 C++ primer on multithreading Alex R. Mosteo
2011-04-20 11:23 ` Peter C. Chapin
2011-04-20 13:06   ` Alex R. Mosteo
2011-04-20 11:32 ` Dmitry A. Kazakov
2011-04-20 12:00 ` Maciej Sobczak
2011-04-20 13:04   ` Alex R. Mosteo
2011-04-20 14:34     ` Georg Bauhaus
2011-04-20 20:44     ` Maciej Sobczak [this message]
2011-04-21  8:50       ` Alex R. Mosteo
2011-04-21  6:58     ` Dmitry A. Kazakov
2011-04-21 21:03       ` Maciej Sobczak
2011-04-22  8:38         ` Dmitry A. Kazakov
2011-04-22 21:45           ` Maciej Sobczak
2011-04-23  6:51             ` Dmitry A. Kazakov
2011-04-23 21:35               ` Maciej Sobczak
2011-04-24  7:42                 ` Dmitry A. Kazakov
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox