How to test MT safeness for named locales?
Benjamin Kosnik
bkoz@redhat.com
Sat Oct 12 19:01:00 GMT 2002
> Are there are testcases available to test the MT safeness for named
> locales ?
No. Your contribution would be welcomed.
> I've noticed in locale.cc global() routine, it is marked as not MT safe.
> How exactly can i prove that it is indeed not MT safe ?
You might want to try starting up N number of named locales at once, and
do time/date/ctype/collate etc formatting on each one, for the specific
locale. In particular, ctype seems like a particular spot to probe for
weaknesses, as does the setting/resetting via setlocale in the generic
locale model in num_get/num_put. You can find examples of
locale-dependent formatting in the existing testsuites. See if anything
breaks.
locale::global should probably be locked.
You can look at some of the threaded locale tests that used to break
in testsuite/thread/*.
-benjamin
More information about the Libstdc++
mailing list