[concurrency-interest] Single writer multiple readers no barriers -- safe ?
vitalyd at gmail.com
Wed Jun 4 16:00:56 EDT 2014
If you had multiple writers publishing a reference, lazySet won't work -
you'd need a CAS loop (or locking, depending on expected
Sent from my phone
On Jun 4, 2014 3:13 PM, "vikas" <vikas.vksingh at gmail.com> wrote:
> >>On Fri, Nov 29, 2013 at 6:51 AM, Nitsan Wakart <[hidden email]> wrote:
> >>From my experience, lazySet is indeed your best choice (but only a valid
> choice for a single writer). You >>need a volatile read to match the HB
> relationship otherwise the compiler is free to optimize the value you
> >>read, so someone using your map in a loop may end up stuck if you don't
> Hi Nitsan,
> Why you said lazySet is a valid choice for single writer. Can you give
> any reference or example on what can go wrong with multiple writers.
> >> You hopefully meant StoreStore | LoadStore . Otherwise we have a very
> >> subtle but serious problem. >>(See
> >> *http://www.hpl.hp.com/personal/Hans_Boehm/c++mm/no_write_fences.html
> >> *for a C++ discussion >>from a few years ago.)
> Hi Hans,
> The link you provided is no more valid. Can you please provide the fresh
> View this message in context:
> Sent from the JSR166 Concurrency mailing list archive at Nabble.com.
> Concurrency-interest mailing list
> Concurrency-interest at cs.oswego.edu
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Concurrency-interest