[concurrency-interest] a question about concurrent safe access

Peter Veentjer - Anchor Men p.veentjer at anchormen.nl
Mon Sep 19 05:30:37 EDT 2005


As far as I know a object reference is always set atomic. So you can`t
get a non existing references unlike the double or long for example (you
can get non existing numbers because only a part of the number is
updated). 

________________________________

Van: concurrency-interest-bounces at cs.oswego.edu
[mailto:concurrency-interest-bounces at cs.oswego.edu] Namens Yechiel
Feffer
Verzonden: maandag 19 september 2005 12:14
Aan: concurrency-interest at altair.cs.oswego.edu
Onderwerp: [concurrency-interest] a question about concurrent safe
access



Hi all 
say I have a pointer ( reference) to an object ( A). This reference is
changed to point at object B. I have threads that concurrently are using
that reference to get the object it points at. I dont want to
synchronize the usage of the reference. Is it safe to do so, i.e. if I
dont use a lock and I dont declare the reference volatile will I always
get object A or B or do I have a risk of getting "dirty" inconsistent
pointer , i.e. is assigning a pointer always atomic  ? 

Regrds, 
Yechiel   

-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/attachments/20050919/9f6ef193/attachment.htm


More information about the Concurrency-interest mailing list