From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,371144ace2969d7e X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!z31g2000vbs.googlegroups.com!not-for-mail From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Re: C++ primer on multithreading Date: Wed, 20 Apr 2011 13:44:31 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: NNTP-Posting-Host: 83.3.40.82 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1303332271 26094 127.0.0.1 (20 Apr 2011 20:44:31 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 20 Apr 2011 20:44:31 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: z31g2000vbs.googlegroups.com; posting-host=83.3.40.82; posting-account=bMuEOQoAAACUUr_ghL3RBIi5neBZ5w_S User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13,gzip(gfe) Xref: g2news2.google.com comp.lang.ada:19900 Date: 2011-04-20T13:44:31-07:00 List-Id: On Apr 20, 3:04=A0pm, "Alex R. Mosteo" 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 protecte= d > stuff in C++ that spares me dealing with mutexes to emulate a synchronize= d > 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