libstdc++/7445: poor performance of std::locale::classic() in multi-threaded applications

Alex Kompel shurik@sequoiap.com
Tue Nov 12 12:49:00 GMT 2002


> 
> >I am a bit confused. Audit trail is kind of hard to read. Have you been
> >waiting on something from me?
> 
> Uh. Yeah.
> 
> We need a test case. Provide one and we'll re-open this. I thought I'd
> made this clear, but apparently not.
> 

See the attached file. 
get_locale() is functionally equivalent to std::locale::classic()

----- test results (RedHat 7.3 2.4.18-17.7.xsmp 2 CPU -----
[root@epos4 test]# c++ -DDO_LOCK -o test_lock -pthread loc_thr.cpp
[root@epos4 test]# c++ -o test_nolock -pthread loc_thr.cpp
[root@epos4 test]# ./test_lock
Creating thread 0
Creating thread 1
Creating thread 2
Creating thread 3
Starting sorting...
Sorting time:    4.08
Sorting time:    4.02
Sorting time:    4.26
Sorting time:    4.21
[root@epos4 test]# ./test_nolock
Creating thread 0
Creating thread 1
Creating thread 2
Creating thread 3
Starting sorting...
Sorting time:    0.06
Sorting time:    0.06
Sorting time:    0.06
Sorting time:    0.06
-------------- next part --------------
A non-text attachment was scrubbed...
Name: loc_thr.cpp
Type: application/octet-stream
Size: 2602 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-bugs/attachments/20021112/6bd624b9/attachment.obj>


More information about the Gcc-bugs mailing list