Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.programming.threads > #2743

Re: About my new algorithm

From "Chris M. Thomasson" <no@spam.invalid>
Newsgroups comp.programming.threads
Subject Re: About my new algorithm
Date 2014-12-06 13:45 -0800
Organization Aioe.org NNTP Server
Message-ID <m5vteu$dp3$1@speranza.aioe.org> (permalink)
References <m5qvr9$o4v$3@dont-email.me> <m5t191$28r$1@speranza.aioe.org> <slrnm84di2.je0.dave@fly.srk.fer.hr>

Show all headers | View raw


> "Drazen Kacar"  wrote in message 
> news:slrnm84di2.je0.dave@fly.srk.fer.hr...

> > Chris M. Thomasson wrote:

> >  Comparing RCU read-side with anything that uses an atomic rmw and/or
> >  memory barrier is just plain foolish. That LOCK ADD destroys 
> > performance
> >  when compared to RCU's basically zero overhead reads. End of story.

> I don't quite understand the "or" part of your "and/or memory barrier"
> statement. If there was a different algorithm which used only memory
> barrier, but not RMW, would that be so much worse than RCU?

Yes. Anytime you can reduce the number of memory barriers and/or
atomics, the better. I have tested RCU verses the same RCU with a single
MFENCE instruction on the reader side. The one without the membar
slaughtered it wrt reads-per-second per-thread.



> Another thing I don't quite understand is in Wikipedia's RCU article (at
> http://en.wikipedia.org/wiki/Read-copy-update, section Simple
> implementation)

> The article says:

>   [RCU's] read-side overhead is precisely zero, as
> smp_read_barrier_depends()
>   is an empty macro on all but DEC Alpha CPUs;[19] such memory barriers 
> are
>   not needed on modern CPUs.

> I was under the impression that you'd need memory barrier on Alpha because
> it does more agressive memory access reordering than other processors.
> But then, if that's correct, that means that modern CPUs (whichever they
> are) still don't have features that old Alpha CPUs have. And not the other
> way round.

Yup. On a DEC Alpha, RCU simply needs a membar for it does not honor
data-dependent loads. RCU relies on data-dependences being there. 

Back to comp.programming.threads | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

About my new algorithm Ramine <ramine@1.1> - 2014-12-04 19:57 -0800
  Re: About my new algorithm Ramine <ramine@1.1> - 2014-12-04 20:07 -0800
  Re: About my new algorithm "Chris M. Thomasson" <no@spam.invalid> - 2014-12-05 11:32 -0800
    Re: About my new algorithm Drazen Kacar <dave@fly.srk.fer.hr> - 2014-12-05 22:48 +0000
      Re: About my new algorithm "Chris M. Thomasson" <no@spam.invalid> - 2014-12-06 13:45 -0800
        Re: About my new algorithm "Chris M. Thomasson" <no@spam.invalid> - 2014-12-06 13:56 -0800

csiph-web