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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC 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: g2news1.google.com!news4.google.com!feeder1-2.proxad.net!proxad.net!feeder2-2.proxad.net!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: C++ primer on multithreading Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <9014siefelqm$.18a5dek2p9s4h$.dlg@40tude.net> <4c5fb8d6-7785-4c9f-bcf0-2bf6b3bb2cb0@e26g2000vbz.googlegroups.com> <1fr5ppc41ca7u.1oh598fh7fh9w.dlg@40tude.net> Date: Sat, 23 Apr 2011 08:51:40 +0200 Message-ID: NNTP-Posting-Date: 23 Apr 2011 08:51:40 CEST NNTP-Posting-Host: b2a7d563.newsspool4.arcor-online.net X-Trace: DXC=kRf\c8AeX[9d8Nb@@ZG@b=4IUK[ On Fri, 22 Apr 2011 14:45:02 -0700 (PDT), Maciej Sobczak wrote: > On Apr 22, 10:38�am, "Dmitry A. Kazakov" > wrote: > >>> What "pulse event"? They are not needed at all. >> >> Pulse event is an event reset automatically after notification all waiting >> threads. > > That's why they are not needed here. After putting new item to the > queue (or removing one item - as already said, these are symmetric > problems), you need to wake up only one waiting thread, not all of > them. For that you need a queue of threads rather than or additionally to the queue of items and resume/suspend method instead of events. This is a different approach, which I had difficulties with. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de