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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham 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-7-bit Path: g2news1.google.com!news4.google.com!feeder.news-service.com!news.albasani.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: "Alex R. Mosteo" Newsgroups: comp.lang.ada Subject: Re: C++ primer on multithreading Followup-To: comp.lang.ada Date: Thu, 21 Apr 2011 10:50:26 +0200 Organization: A noiseless patient Spider Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit Injection-Date: Thu, 21 Apr 2011 08:50:25 +0000 (UTC) Injection-Info: mx01.eternal-september.org; posting-host="GTXwwBF3FOlS510nQf8qvQ"; logging-data="1762"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18Nx8sEGF1rQFievXlU4/6N" User-Agent: KNode/4.4.9 Cancel-Lock: sha1:9Pcr1VA+LeCaubzXi9DB7fjR+bU= Xref: g2news1.google.com comp.lang.ada:18943 Date: 2011-04-21T10:50:26+02:00 List-Id: Maciej Sobczak wrote: > On Apr 20, 3:04 pm, "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. I'll do, thanks. > >> 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. Boost is it then. Thanks to everyone! Alex. > > -- > Maciej Sobczak * http://www.msobczak.com * http://www.inspirel.com