I have used boost::shared_ptr in TBB applications before and it seemed to work just fine. I believe there are atomic increment and decrement operations within it. For some reason I think there is a mutex buried in there as well, but I'm not sure that there is... I would ask on the Boost mailing lists for a better answer... it should be possible to replace the boost atomic operations with ones from TBB, again ask on the boost mailing list for more details.
In my experience, boost::shared_ptr had horrible performance. However, this is all relative. In my case, the pointers would increment and decrement millions of times in a short time... the majority of my algorithm related to pointer manipulations, so it became a bottleneck in that case... which looking back on it I say "of course". If you have a large number of pointers, which are being used a lot... I would consider a different approach, but of course that was just based on my experience, and code profiling revealed that something insane like 60% of execution time was spent on shared_ptr atomic operations.
I have written pointer containers that use TBB constructs instead, you might be interested in those. They are used for exception safety, to call delete on all contained pointers if it goes out of scope. Boost has something similar too.
Intel Software Network Forums Statistics
8473 users have contributed to 31605 threads and 100654 posts to date.
In the past 24 hours, we have 30 new thread(s) 110 new posts(s), and 160 new user(s).