Boost logo

Boost Users :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2002-12-12 15:12:11


From: "Duane Murphy" <duanemurphy_at_[hidden]>
>
> The problem that I am concerned about is lifetime control. Objects in the
> main thread could be deleted before the worker thread has a chance to use
> them. This of course would be a "bad thing."
>
> I am considering investigating the use of weak_ptr as a potential
> solution to this problem. The basic idea would be to pass weak_ptr's to
> the worker thread. The worker thread can then check the validity of the
> weak_ptr before accessing it.
>
> Can weak_ptr be used without using shared_ptr? It seems like they are
> closely tied. I was hoping to use weak_ptr without forcing the use of
> shared_ptr.

No, weak_ptr cannot be used without shared_ptr. Why do you need to avoid
shared_ptr?


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