Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.programming.threads > #619
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.42!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder1-1.proxad.net!198.186.194.250.MISMATCH!news-out.readnews.com!news-xxxfer.readnews.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail |
|---|---|
| From | dvyukov@google.com |
| Newsgroups | comp.programming.threads |
| Subject | Re: usage of vyukov's mpsc queue |
| Date | Sun, 2 Oct 2011 04:13:35 -0700 (PDT) |
| Organization | http://groups.google.com |
| Lines | 21 |
| Message-ID | <165625.663.1317554015291.JavaMail.geo-discussion-forums@yqbr29> (permalink) |
| References | <3b312755-24d8-4505-8cfe-1644c458c4d5@j1g2000yqn.googlegroups.com> <239216de-c8d6-49bb-b5bd-e9437665431c@l7g2000vbz.googlegroups.com> <4E7A1FF6.3671780C@web.de> |
| Reply-To | comp.programming.threads@googlegroups.com |
| NNTP-Posting-Host | 109.173.89.91 |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=ISO-8859-1 |
| X-Trace | posting.google.com 1317554118 7568 127.0.0.1 (2 Oct 2011 11:15:18 GMT) |
| X-Complaints-To | groups-abuse@google.com |
| NNTP-Posting-Date | Sun, 2 Oct 2011 11:15:18 +0000 (UTC) |
| Cc | terekhov@web.de |
| In-Reply-To | <4E7A1FF6.3671780C@web.de> |
| Complaints-To | groups-abuse@google.com |
| Injection-Info | glegroupsg2000goo.googlegroups.com; posting-host=109.173.89.91; posting-account=NBD_RQoAAACHR-YW19P_kwUzWUxgq4jl |
| User-Agent | G2/1.0 |
| X-Google-Web-Client | true |
| Xref | x330-a1.tempe.blueboxinc.net comp.programming.threads:619 |
Show key headers only | View raw
On Wednesday, September 21, 2011 9:33:42 PM UTC+4, Alexander Terekhov wrote:
> Dmitriy Vyukov wrote:
> >
> > Since you are doing signaling (SetEvent) after each push, I think you
> > don't need anything special for it to work.
> > However of course you need correct memory fences in the queue
> > algorithm itself, that is I think as follows:
> >
> > void mpscq_push(mpscq_t* self, mpscq_node_t* n)
> > {
> > n->next = 0;
> > mpscq_node_t* prev = XCHG(&self->head, n); // ACQUIRE_RELEASE
>
> "// ACQUIRE" (without _RELEASE) is sufficient here.
>
> But XCHG(...) can be totally relaxed with respect to memory barriers if
> implemented as load-reserve/store-conditional or CAS loop (making
> subsequent stores control-dependent).
In my model there is no such thing as "control-dependent", each acquire simply must pair with release :)
But I am curious about your model, how is n->next=0 prevented from sinking below XCHG (which would be a disaster)? It seems that even a compiler can easily do that.
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