$include_dir="/home/hyper-archives/boost/include"; include("$include_dir/msg-header.inc") ?>
From: williamkempf_at_[hidden]
Date: 2001-08-03 09:32:26
--- In boost_at_y..., "Scott McCaskill" <scott_at_m...> wrote:
> > > Right now it checks (polls) periodically to see if any have 
ended.
> > I'm
> > > considering what the implications would be if I changed it to 
wait
> > (block)
> > > until any thread ended.
> >
> > Just curious, but what does it do if the poll indicates a thread 
has
> > died?
> >
> 
> Currently it just logs an error, but for some threads we may want 
to start
> them again.  The design is still evolving, as you may have 
guessed ;)
Well, keep me informed of areas you find in which Boost.Threads seems 
to be lacking functionality you need.
As for this particular discussion, in the near future (before 
submission which is coming very quickly *yikes*), the tss class will 
support cleanup handlers even on Win32 and could be used to signal 
the condition.  That said, however, I'd strongly recommend you avoid 
thread exits in your code any way.  I'm not sure how POSIX threads 
work in this regard (though I'd expect the same behavior), but a call 
to ExitThread in Win32 does not unwind the stack properly in C++.  In 
other words, destructors for objects on the stack are not called.  In 
a C++ program this can mean a lot of resource leaks occur.  Even SEH 
__finally blocks aren't run.  It would simply be safer to restructure 
your code to not have multiple exit points.  This is the reason 
Boost.Threads doesn't have a thread:exit() or define cancellation 
points.
Bill Kempf