Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.programming.threads > #592
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail |
|---|---|
| From | Alexander Terekhov <terekhov@web.de> |
| Newsgroups | comp.programming.threads |
| Subject | Re: usage of vyukov's mpsc queue |
| Date | Wed, 21 Sep 2011 18:20:13 +0200 |
| Organization | A noiseless patient Spider |
| Lines | 39 |
| Message-ID | <4E7A0EBD.EF170AC8@web.de> (permalink) |
| References | <3b312755-24d8-4505-8cfe-1644c458c4d5@j1g2000yqn.googlegroups.com> <4E79BA45.B3622870@web.de> <2011092106580817537-ephisinowitz@yahoocom> <4E79D246.E338E050@web.de> <39ca082e-34ad-43f5-8f6d-9944ae840875@l4g2000vbv.googlegroups.com> <4E79E431.59EFC897@web.de> <7f52d142-c0f4-4898-a498-2cf78fb4f97e@k15g2000yqd.googlegroups.com> <4E79FD7A.F4557F50@web.de> <94ee4bc5-9502-4b0c-9b45-46e5f5ef8f9f@l2g2000vbn.googlegroups.com> |
| Reply-To | terekhov@web.de |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=us-ascii |
| Content-Transfer-Encoding | 7bit |
| Injection-Info | mx04.eternal-september.org; posting-host="MCbSEzW5qwGLFMNXJh39IQ"; logging-data="22952"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19MmwI8G0QGE+K+B4n3ERMgxmitHg5+MU0=" |
| X-Mailer | Mozilla 4.77 [en] (Windows NT 5.0; U) |
| X-Accept-Language | en |
| Cancel-Lock | sha1:1EeIxlIAlMq6CxDeUNkJH7/Iuas= |
| Xref | x330-a1.tempe.blueboxinc.net comp.programming.threads:592 |
Show key headers only | View raw
Ephi Sinowitz wrote:
>
> On Sep 21, 11:06 am, Alexander Terekhov <terek...@web.de> wrote:
> > Ephi Sinowitz wrote:
> >
> > [...]
> >
> > > Producers set event after the push(). Event only transitions from
> > > unset to set when producer is inside the while loop.
> > > Now when Consumer goes back to Wait he should see the set event. The
> > > only issue is that he may still see a NULL next pointer because there
> > > are no memory barriers in the push(). In that case the consumer will
> > > go back to wait and the event will stay unset forever. But the 30
> > > second time limit should take care of that.
> > > for(;;)
> > > WaitForSingleObject(m_queueEvent, 30000);
> > > while (void* item = vyukov_queue.pop())
> > > {
> > > // do work
> > > }
> > > }
> >
> > With *timed* wait on <whatever> in consumer, push() and pop() need the
> > same barriers as without <whatever> blocking synchronization object.
> >
> > Think of it as sleep(30) instead of WaitForSingleObject(m_queueEvent,
> > 30000).
> >
> > regards,
> > alexander.
>
> But that's the point. This queue does not need any memory barriers if
> the consumer is just spinning with a sleep.
Who told you that, Ephi?
regards,
alexander.
Back to comp.programming.threads | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
usage of vyukov's mpsc queue Ephi Sinowitz <esinowitz.public@gmail.com> - 2011-09-20 06:55 -0700
Re: usage of vyukov's mpsc queue Joshua Maurice <joshuamaurice@gmail.com> - 2011-09-20 17:19 -0700
Re: usage of vyukov's mpsc queue Ephi Sinowitz <esinowitz.public@gmail.com> - 2011-09-20 18:35 -0700
Re: usage of vyukov's mpsc queue Ephraim Sinowitz <ephisinowitz@yahoo.com> - 2011-09-21 06:42 -0400
Re: usage of vyukov's mpsc queue Joshua Maurice <joshuamaurice@gmail.com> - 2011-09-21 00:26 -0700
Re: usage of vyukov's mpsc queue Alexander Terekhov <terekhov@web.de> - 2011-09-21 12:19 +0200
Re: usage of vyukov's mpsc queue Alexander Terekhov <terekhov@web.de> - 2011-09-21 12:34 +0200
Re: usage of vyukov's mpsc queue Ephi Sinowitz <ephisinowitz@yahoo.com> - 2011-09-21 06:58 -0400
Re: usage of vyukov's mpsc queue Alexander Terekhov <terekhov@web.de> - 2011-09-21 14:02 +0200
Re: usage of vyukov's mpsc queue Ephi Sinowitz <esinowitz.public@gmail.com> - 2011-09-21 06:08 -0700
Re: usage of vyukov's mpsc queue Alexander Terekhov <terekhov@web.de> - 2011-09-21 15:18 +0200
Re: usage of vyukov's mpsc queue Ephi Sinowitz <esinowitz.public@gmail.com> - 2011-09-21 06:56 -0700
Re: usage of vyukov's mpsc queue Alexander Terekhov <terekhov@web.de> - 2011-09-21 17:06 +0200
Re: usage of vyukov's mpsc queue Ephi Sinowitz <esinowitz.public@gmail.com> - 2011-09-21 09:16 -0700
Re: usage of vyukov's mpsc queue Alexander Terekhov <terekhov@web.de> - 2011-09-21 18:20 +0200
Re: usage of vyukov's mpsc queue Dmitriy Vyukov <dvyukov@gmail.com> - 2011-09-21 09:58 -0700
Re: usage of vyukov's mpsc queue Alexander Terekhov <terekhov@web.de> - 2011-09-21 19:33 +0200
Re: usage of vyukov's mpsc queue dvyukov@google.com - 2011-10-02 04:13 -0700
Re: usage of vyukov's mpsc queue Alexander Terekhov <terekhov@web.de> - 2011-10-04 12:15 +0200
Re: usage of vyukov's mpsc queue Ephi Sinowitz <esinowitz.public@gmail.com> - 2011-09-21 11:04 -0700
Re: usage of vyukov's mpsc queue Ephi Sinowitz <esinowitz.public@gmail.com> - 2011-09-21 11:17 -0700
Re: usage of vyukov's mpsc queue "Chris M. Thomasson" <cristom@charter.net> - 2011-09-24 22:44 -0700
csiph-web