Boost logo

Boost Users :

Subject: Re: [Boost-users] [Intrusive] Using a mutex-guarded smart pointer to achieve thread-safety
From: Ion Gaztañaga (igaztanaga_at_[hidden])
Date: 2011-09-22 05:07:49


El 22/09/2011 4:23, Ioannis Papadopoulos escribió:
> Hi,
>
> I was looking over Boost.Intrusive and specifically the section
> regarding smart pointers.
>
> I am mostly interested in the linked lists, so I don't have any need for
> size(); auto-unlink however is extremely useful to me.
>
> If I replace the default pointer with my thread-safe smart_ptr-like type
> (for example a wrapper that instead of doing reference counting, it
> guards the pointers with a mutex), do you think that the resulting
> intrusive container will be thread-safe?

I don't think so, making pointer operations atomic does not convert
container operations atomic.

Ion


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