Boost logo

Boost Users :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2005-04-26 04:54:43


Ross Manges wrote:
> It appears that there are a lot of restrictions on how shared_ptrs
> can be used in a multithreaded program, and I may be breaking some of
> those restrictions as it is easy to do so.

There is one restriction: all write accesses to a specific shared_ptr need
to be exclusive. This is the usual Posix model, also called "as thread safe
as an int" and "basic thread safety". It applies to most shared variables in
a program.

But I agree that it is easy to break the rules. And there is always the
possibility that your program is fine, but there might be a thread-related
error in shared_ptr (these are very difficult to find). So please let me
know if you find out more.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net