
5 Feb
2007
5 Feb
'07
10:24 p.m.
Hello Steven, Tuesday, February 6, 2007, 1:07:01 AM, you wrote:
AMDG
Andrey Semashev <andysem <at> mail.ru> writes:
Well, the dispatcher is quite safe even if it's initialized more than once and even concurrently. Being a namespace-scope object is quite sufficient for it. But state names, which are std::strings, are quite fragile in this way. And unfortunately volatile flags won't help here.
You can use const char* or aligned_storage
The problem is I don't know how to synchronize its initialization safely. Mutex construction should be synchronized too, that's the whole problem. I'll have think of it some more. -- Best regards, Andrey mailto:andysem@mail.ru