Boost logo

Boost :

From: Greg Colvin (gcolvin_at_[hidden])
Date: 2001-06-27 13:46:42


Does it change your mind to be told that there is no thread* raw
pointer to escape from thread::ref, and the reference counting
is a hidden implementation detail for achieving copy semantics
on platforms that don't count or garbage collect implicitly?

From: Gary Powell <Gary.Powell_at_[hidden]>
> [Greg Colvin]
> What is important to me is having a safely copyable handle
> for managing a thread, as I think that trying to roll my
> own with shared_ptr will be perilous and more difficult
> and less efficient than necessary.
>
> [Gary]
> I would prefer a second boost layer that does the reference counting. So
> that when I don't need/want/can't/use it I don't have to.
>
> class Thread_ref {
> public:
> Thread_ref(Thread_id) {}
> };
>
> where Thread_id is not copyable and a Thread_ref is.
>
> I know it adds complexity but my recent experience with shared_ptr<> has
> made me very wary of them. (The once you make a raw pointer shared, there is
> no way to "unshare it or release it, as in pass the ownership to something
> else.) While I admit this is less of an issue for threads, I would prefer
> the extra helper layer. (Even if all the higher levels all use the
> Thread_ref objects.)
>
> I'd also supply a creation/conversion fn.
>
> Thread_ref threads::createRefThread(proc);
>
>
> Yours,
> -gary-
>
>
> gary.powell_at_[hidden]
>
> Info: http://www.boost.org Unsubscribe: <mailto:boost-unsubscribe_at_[hidden]>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk