« Return to Thread: [smart_ptr] shared_ptr template type

Re: [smart_ptr] shared_ptr template type

by Sid Sacek-3 :: Rate this Message:

Reply to Author | View in Thread


-----Original Message-----
From: boost-bounces@...
[mailto:boost-bounces@...] On Behalf Of Gottlob Frege

> I don't think lock/unlock on each -> call is typically a good idea.
>  x = p->x;
>  y = p->y;
> That's 2 lock unlock sequences instead of one.  Inefficient and what
> if y changes after you read x?
> It hides the locking too much, potentially leading to abuse and
mistakes.
>
> Tony


I agree and disagree. I would at some point want to create a class
similar to what's being described, but would not expose it to the rest
of the world to use ( and abuse ). A class like that could come in
handy, as long as it's used with the knowledge of its strengths and
limitations.

-Sid Sacek

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

 « Return to Thread: [smart_ptr] shared_ptr template type