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!e26g2000vbz.googlegroups.com!not-for-mail From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Re: C++ primer on multithreading Date: Thu, 21 Apr 2011 14:03:20 -0700 (PDT) Organization: http://groups.google.com Message-ID: <4c5fb8d6-7785-4c9f-bcf0-2bf6b3bb2cb0@e26g2000vbz.googlegroups.com> References: <9014siefelqm$.18a5dek2p9s4h$.dlg@40tude.net> NNTP-Posting-Host: 77.65.97.192 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1303419801 22793 127.0.0.1 (21 Apr 2011 21:03:21 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 21 Apr 2011 21:03:21 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: e26g2000vbz.googlegroups.com; posting-host=77.65.97.192; 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:19937 Date: 2011-04-21T14:03:20-07:00 List-Id: On Apr 21, 8:58=A0am, "Dmitry A. Kazakov" wrote: > An interesting issue is the producer's behavior when the queue is full. I > presume it would fail Or block. Being full is symmetric to being empty (hint: being full means that you run out of empty space, which means that the reserve of empty space is... empty :-) ). > or the queue may grow infinitely (:-)) There are no infinite computers yet. You will get the out of memory condition, which in C++ is reported with an exception. This is handled cleanly: mutex will be automatically unlocked and consumers will not be affected. > You may need > an additional pulse event to handle this more reasonably. What "pulse event"? They are not needed at all. -- Maciej Sobczak * http://www.msobczak.com * http://www.inspirel.com