This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: How to test MT safeness for named locales?
- From: Benjamin Kosnik <bkoz at redhat dot com>
- To: Bourne <bourne at toughguy dot net>
- Cc: libstdc++ at gcc dot gnu dot org
- Date: Sat, 12 Oct 2002 21:01:33 -0500
- Subject: Re: How to test MT safeness for named locales?
- Organization: Red Hat / Chicago
- References: <3DA80BCD.57C07E17@toughguy.net>
> 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