|
Boost Users : |
Subject: Re: [Boost-users] [thread] boost::thread automatically detached when thread terminates?
From: Boris Schaeling (boris_at_[hidden])
Date: 2010-09-12 12:05:30
On Sun, 12 Sep 2010 15:12:35 +0200, Ray Burkholder <ray_at_[hidden]>
wrote:
>> >> Thanks for your reply! Do you know whether the thread of execution is
>> >> allowed to call boost::thread::detach()? Then it could detach itself
>> >> from the boost::thread object before it terminates and
>> >> boost::thread::joinable() should work? I'm not sure though if
>> >> boost::thread is thread-safe?
>>
>> I want a worker thread to terminate if there is nothing to do. If there
>> is
>> something to do again and the worker thread has terminated I need to
>> create a new one. Now I wonder if I can use boost::thread to detect
>> whether the thread is running or not.
>>
>
> How about using boost::asio. It automatically deals with worker threads
> and
> such.
I need the worker thread within a Boost.Asio extension. ;)
Boris
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net