Hi
Is there any plans to addpointer containers like boost ptr_vector? It would be better than storing a referenced counted smart pointer.
Link Copied
There's no current plan to add such. Is there some way that TBB could improve upon the existing Boost implementation?
MADadrobiso:
There's no current plan to add such. Is there some way that TBB could improve upon the existing Boost implementation?
Yes, the boost implementation is not threadsafe. To use TBB containers with pointers, I have to store a referenced count smart pointer (boost shared_ptr), which takes more memory and slower. Boost Ptr containers was designed to avoid using STL containers with boost shared_ptr.
aj.guillon@gmail.com:
Hey,
I implemented something like that... here's a link. I plan on implementing it again now that I am more familiar with template programming, and do a better job on it. This is an older version, I have a new SVN repository that I'll get you the link for... the newer version has iterators...
http://code.google.com/p/tbbcommunity/source/browse/trunk/include/tcc/ptr_container/ptr_vector.h
I lurk on #tbb on Freenode if you need help or want to help out with some generic Boost-like components for TBB... my long-term idea is to make tbbcommunity.org something like Boost but for TBB.
AJ
Cool work AJ. That is what I'm looking for. If you can addall TBB containers working, it will be fantastic. I just curious, I see you are implementing a mutex lock on STL containers, isn't it better to integrate/modify TBB container directly?
I see. It's quite an effort and it's something very useful so I hope Intel can officially include a ptr container version.
Sorry. I don't go to irc much cos my timezone is at the total opposite of everyone :)
My time zone is +8, that outcast people in UK and Europe too.
Unfortunately I do not have the time or expertise to implement a good tbb container. Perhaps you can try taking the idea to be boost to be boostified, there are moredevelopers thathave more expertise about threading and container design to review and design.
For more complete information about compiler optimizations, see our Optimization Notice.