Optimization of conditional access to globals: thread-unsafe?

Tomash Brechko tomash.brechko@gmail.com
Mon Oct 29 08:44:00 GMT 2007


On Mon, Oct 29, 2007 at 09:31:13 +0100, Eric Botcazou wrote:
> > The value that will be seen by other threads after they synchronize
> > memory (with pthread_mutex_lock(), for instance).
> 
> What does it mean from the viewpoint of the current thread?

It means that the current thread is free to cache the value in the
register as long as it knows no other thread can access it (i.e. as
long as it holds corresponding mutex).


-- 
   Tomash Brechko



More information about the Gcc mailing list