$include_dir="/home/hyper-archives/boost/include"; include("$include_dir/msg-header.inc") ?>
From: williamkempf_at_[hidden]
Date: 2001-06-30 22:31:07
--- In boost_at_y..., "Peter Dimov" <pdimov_at_m...> wrote:
> From: "Peter Dimov" <pdimov_at_m...>
>
> [Replying to myself... What's next? A dedicated mailing list just
for me?
> :-) ]
>
> > So my point is that a good implementation of thread::ref can
directly
> > compete with the 'layer 1' noncopyable thread object and be an
order of
> > magnitude more efficient than 'layer 2' shared_ptr<thread>, while
at the
> > same time being more user-friendly.
>
> Reality check.
>
> The above is true with regard to thread-related resources, but it
ignores
> the problem with the lifetime of the arbitrary function object that
is
> passed to thread::create.
>
> A design with
>
> thread::ref thread::create(void (*) (void *), void *);
>
> plus the corresponding helpers for managing the parameter passing
and
> dealing with different function signatures still has the properties
outlined
> above.
>
> A design that takes boost::function0<void>, sadly, does not, as far
as I can
> see. Someone has to manage the function object, and the logical
place to put
> it is in the noncopyable thread.
I don't follow this. What do you mean by "manage the function
object"? Do you mean it's lifetime? There's nothing to manage there.
Bill Kempf