[cpp-threads] static locals

Hans Boehm Hans.Boehm at hp.com
Mon May 30 07:35:00 BST 2005


On Sun, 29 May 2005, Peter Dimov wrote:

> My opinion is that all local statics should be synchronized (as in the IA64
> ABI) and that __async volatile should not be introduced. So... if I take a
> step back I see no need for new syntactic additions. ;-)
>
If local statics are all synchronized, what does that mean about
memory ordering between the initialization and prior assignments?
If a local static pointer p is initialized to point to a newly allocated
object Q, presumably the initialization of Q should be visible to
other threads using p?  What does that mean for something like

static int i(17);

which would normally be handled at compile time?  Are other later users
of i required to see stores performed by the first thread to reach
the initialization?

Hans




More information about the cpp-threads mailing list