www.digitalmars.com         C & C++   DMDScript  

c++.stlsoft - shared_ptr<>

reply "Cláudio Albuquerque" <cláudio nowhere.com> writes:
Hi Mathew,

I've been looking arround to the shared_ptr<> and my impression is that is 
not thread safe.
If I'm righ, are you thinking of adding the possability of making it thread 
safe through a policy or to provide another implementation?


Regards
Cláudio Albuquerque 
Sep 19 2007
parent reply "Matthew Wilson" <matthew hat.stlsoft.dot.org> writes:
"Cláudio Albuquerque" <cláudio nowhere.com> wrote in message
news:fcqu9l$27uq$1 digitalmars.com...
 Hi Mathew,

 I've been looking arround to the shared_ptr<> and my impression is that is
 not thread safe.
That's correct. Although I'd probably phrase it that its thread-safety is not defined. ;-)
 If I'm righ, are you thinking of adding the possability of making it
thread
 safe through a policy or to provide another implementation?
I wasn't, but I'm happy to consider it. I'm hoping to get some STLSoft-time this w/e. If you want to make any suggestions, we can maybe get them in the next release ... Cheers Matt
Sep 20 2007
parent "Cláudio Albuquerque" <cláudio nowhere.com> writes:
Hi Mathew,

Well I due like policy allot, maybe too much, the problem there is that I 
end up with too many template parameter's ... but that's another story.

Mentioning another lib that I use (but ours is still my favorite one ;-) ) I 
do like the idea behind Loki's pointers but in the end It's over to 
"complicated", although due like the power and flexibility. (This reminds me 
of the first pages of a nice book I'm reading now, Extending STL, that say 
exactly that, if it's too complicated to use or to discover people tend to 
stay away or build their own...)

So in this case my suggestion would go to a template parameter that would 
state the policy for multithread or not.

PS: By the way did you forget the scoped_method<> ... ?

Regards
Cláudio Albuquerque


"Matthew Wilson" <matthew hat.stlsoft.dot.org> wrote in message 
news:fcui6p$811$1 digitalmars.com...
 "Cláudio Albuquerque" <cláudio nowhere.com> wrote in message
 news:fcqu9l$27uq$1 digitalmars.com...
 Hi Mathew,

 I've been looking arround to the shared_ptr<> and my impression is that 
 is
 not thread safe.
That's correct. Although I'd probably phrase it that its thread-safety is not defined. ;-)
 If I'm righ, are you thinking of adding the possability of making it
thread
 safe through a policy or to provide another implementation?
I wasn't, but I'm happy to consider it. I'm hoping to get some STLSoft-time this w/e. If you want to make any suggestions, we can maybe get them in the next release ... Cheers Matt
Sep 20 2007