comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: C++ primer on multithreading
Date: Sat, 23 Apr 2011 08:51:40 +0200
Date: 2011-04-23T08:51:40+02:00	[thread overview]
Message-ID: <xc0njr6l0g5g$.mhidf5rsyq80.dlg@40tude.net> (raw)
In-Reply-To: f4569e31-4f53-4a86-a809-0553c0a19495@p6g2000vbn.googlegroups.com

On Fri, 22 Apr 2011 14:45:02 -0700 (PDT), Maciej Sobczak wrote:

> On Apr 22, 10:38�am, "Dmitry A. Kazakov" <mail...@dmitry-kazakov.de>
> 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



  reply	other threads:[~2011-04-23  6:51 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
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 [this message]
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