
Hello, ----- Original Message ----
From: Jared Lee Richardson
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/