delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/02/18/13:12:19

From: Joe Buck <jbuck AT Synopsys DOT COM>
Message-Id: <199902181810.KAA24126@atrus.synopsys.com>
Subject: Re: [Semi-OT] The C++ Standard Library
To: oliva AT dcc DOT unicamp DOT br (Alexandre Oliva)
Date: Thu, 18 Feb 99 10:10:25 PST
Cc: pderbysh AT usa DOT net, djgpp AT delorie DOT com, egcs AT egcs DOT cygnus DOT com
In-Reply-To: <or4sokyw27.fsf@araguaia.dcc.unicamp.br>; from "Alexandre Oliva" at Feb 18, 99 6:07 am
X-Mailer: ELM [version 2.3 PL11]
Reply-To: djgpp AT delorie DOT com

> On Feb 18, 1999, Paul Derbyshire <pderbysh AT usa DOT net> wrote:
> 
> > Q: Are STL containers guaranteed to be thread safe?

At the risk of sounding like Bill Clinton or Bill Gates: it depends
on what your definition of "thread safe" is.

> No.  You must lock them externally.  However, it seems to me that the
> SGI STL, distributed with egcs, provides some threading support, but
> you'd have to check.

You can read the details about what operations are thread-safe, and
which are not, with SGI STL on

http://www.sgi.com/Technology/STL/thread_safety.html

The relevant paragraph is

> The SGI implementation of STL is thread-safe only in the sense that
> simultaneous accesses to distinct containers are safe, and simultaneous
> read accesses to to shared containers are safe. If multiple threads access
> a single container, and at least one thread may potentially write, then
> the user is responsible for ensuring mutual exclusion between the threads
> during the container accesses.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019