Boost logo

Boost Users :

Subject: Re: [Boost-users] Thread safe intrusive ptr
From: dhruva (dhruva_at_[hidden])
Date: 2009-04-03 23:10:27


Hello, ----- Original Message ---- > From: Jared Lee Richardson <jaredr26_at_[hidden]> > What are the considerations for making intrusive_ptr thread safe? Is > it as simple as a mutex-lock / atomic counter variable? > I suggest using spinlock. I have not yet seen inside the boost code thoroughly, it might be sitting right there. pthread_mutex on UNIX and CRITICAL_SECTION on windows. I am trying to see if atomic operations could help here. The only problem I see is when the reference count reaches zero (0), you need to delete/free the held pointer. The checking of the reference count and freeing the resource has to be atomic and cannot be achieved using purely atomic operations. I am now trying to see if I really do something with only atomic operations and will post my findings. -dhruva Add more friends to your messenger and enjoy! Go to http://messenger.yahoo.com/invite/


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