Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 09 Nov 2000 15:08:55 -0800
From:      Jack Rusher <jar@integratus.com>
To:        James FitzGibbon <james@targetnet.com>
Cc:        hackers@freebsd.org
Subject:   Re: Repeatable STL core with -pthread
Message-ID:  <3A0B2E87.3B49887B@integratus.com>
References:  <20001109161045.D39548@targetnet.com>

next in thread | previous in thread | raw e-mail | index | archive | help
James FitzGibbon wrote:
> 
> The program will core after about 10 seconds, every time.
> It would appear that there is an issue with some low-level allocator in the
> STL as shipped in 4.x.

  Dude.  The STL implementation that ships with g++ isn't thread safe. 
In fact, if you read the STL portion of the C++ specification, you will
notice that threads are not mentioned at all.  The only guarantees made
by the STL are that operations will complete within certain performance
guidelines.

  As a safety tip, the string implementation in the g++ implementation
isn't thread safe either.  It uses a shared buffer scheme ("char*
string->rep") to reduce memory consumption & improve performance.  This
is in opposition to "deep copy" style libraries, like the SGI STL, that
work in threaded environments.

  Because of the way the C++ standard is written, commercial STL
implementations, such as the Rogue Wave library that comes with the Sun
C++ compiler, suffer from the same threading problems.

-- 
Jack Rusher, Senior Engineer | mailto:jar@integratus.com
Integratus, Inc.             | http://www.integratus.com


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3A0B2E87.3B49887B>