Welcome to Intel® Software Network Quick Login | Join | Help |
Search in Intel® Software Network Forums
in Go

Ptr Containers

Last post 07-09-2008, 9:57 PM by imtrobin. 8 replies.
Sort Posts: Previous Next
 06-27-2008, 5:13 AM 30257775  

Ptr Containers

Hi

Is there any plans to add pointer containers like boost ptr_vector? It would be better than storing a referenced counted smart pointer.

 
 07-02-2008, 8:05 AM 30258111 in reply to 30257775  

Re: Ptr Containers

There's no current plan to add such.  Is there some way that TBB could improve upon the existing Boost implementation? 

 
 07-02-2008, 8:48 AM 30258119 in reply to 30257775  

Re: Ptr Containers

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
 
 07-08-2008, 1:07 AM 30258492 in reply to 30258111  

Re: Ptr Containers

MAD\adrobiso:

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.

 
 07-08-2008, 1:12 AM 30258493 in reply to 30258119  

Re: Ptr Containers

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 add all 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?

 
 07-08-2008, 7:18 AM 30258524 in reply to 30258493  

Re: Ptr Containers

Yes it is, but I was just learning templates at the time!  In fact I was also learning a lot about parallel performance, so in hind sight I might not have used a spin_lock.

I will be rebuilding the ptr_container class the "right" way very soon, and do some benchmarks with VTune to make sure it scales well.  I'm waiting on a dual quad-core system to be delivered, at which point I'll be able to do some better tests and work.

Also I lurk on #tbb on freenode.  Feel free to drop by if you need some help or just want to chat and hang out.

AJ
 
 07-08-2008, 9:41 PM 30258600 in reply to 30258524  

Re: Ptr Containers

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 :)

 
 07-09-2008, 8:37 AM 30258650 in reply to 30258600  

Re: Ptr Containers

There are some people on the channel who are from the UK and Europe... might be in the same TZ as you.  We can also schedule a meeting together at a certain time if required.

Also, I think that "Threading Building Blocks" has the "building blocks" part in it for just this reason.  There are a lot of extra components that can be built, but it might not make sense to package them all as part of TBB itself.  Once something is part of TBB, it's going to have to be tested and maintained forever.

My idea for tbbcommunity.org is to have something like Boost where all these extra packages built on TBB can reside in one place with SVN access nd documentation.  People can download the pacages they need, or perhaps a tbbcommunity package can be built which bundles all the stable and useful components together.  This way anyone can contribute a package for distribution... and others using TBB can download a supplementary package to make TBB more powerful.

If you are willing to collaborate, perhaps we can implement a good pointer container together?

AJ
 
 07-09-2008, 9:57 PM 30258712 in reply to 30258650  

Re: Ptr Containers

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 more developers that have more expertise about threading and container design to review and design.

 
View as RSS news feed in XML

Shortcuts


Tags For This Post

...

Community Tags

...