Jeff Squyres, le Fri 12 Mar 2010 07:35:44 -0800, a écrit :
> On Mar 11, 2010, at 10:12 PM, Brice Goglin wrote:
> > I guess we a thread-safety section in hwloc.doxy to document that all
> > topology modifiers (most of hwloc_topology_* functions, not all of them)
> > cannot run concurrently.
> To support that, do we need to make internal variables and fields be volatile?
?! I fail to see why we would need that.
If some threads uses a function that modifies a topology object, no
other thread should be reading it of course, since the reader will
possibly read incoherent data. A volatile qualifier can not fix that,
only mutexes (or transactional memory :) ) can.
> If we say that applications need to provide their own synchronization
> between readers and writers, atomic writes shouldn't be an issue,
I do not understand this either.