Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2002-10-20 10:25:09


"Joe Gottman" <jgottman_at_[hidden]> writes:

> David Abrahams wrote:
> [...]
> > * "Thread-safe": this is a term which is well-defined for programs. It
> > is /not/ well-defined for classes or functions, though the
> > documentation uses it that way repeatedly. ....
>
> The SGI STL implementation gives a good definition of the minimal acceptable
> level of thread safety in a class that may be used in multi-threaded
> programs (see http://www.sgi.com/tech/stl/thread_safety.html ). To
> paraphrase, it says that simultaneous accesses to distinct objects are
> safe, and simultaneous read accesses to shared objects are safe. If a class
> obeys these two rules, then it should be possible to make a shared object of
> that class thread safe by putting a mutex, critical section, etc. arround
> any write accesses to that object.

Yes, a wonderful definition. However, when our text informally says a
class is "not thread safe", it usually fits into the above
category. So we can't fix the docs just by using that definition.

-- 
                    David Abrahams
dave_at_[hidden] * http://www.boost-consulting.com
Building C/C++ Extensions for Python: Dec 9-11, Austin, TX
http://www.enthought.com/training/building_extensions.html

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk