Boost logo

Boost :

From: vicente.botet (vicente.botet_at_[hidden])
Date: 2008-05-28 13:25:35


----- Original Message -----
From: "Anthony Williams" <anthony.ajw_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Wednesday, May 28, 2008 5:04 PM
Subject: Re: [boost] "joinable"

> "vicente.botet" <vicente.botet_at_[hidden]> writes:
>
>> just a question that could clarify my thoughts, can a non joinable thread
>> be
>> interruptible?
>
> No, because you no longer have a handle with which to interrupt it.
>
> I have thought about providing an "interrupt handle" which you can
> obtain either from a boost::thread object, or by calling
> boost::this_thread::get_interrupt_handle() or similar, in which case a
> detached thread would be interruptible.

Ok, the question now is *should* the joinable and interruptible features of
a thead be disociated?
IMO they should. We can need to interrupt a thread even if we are no
interested when the thread finish.

If should be better if the the implementation is possible, but I don't think
that this is a big problem for the user. Most of the applications could work
without releasing the resources that are released when a thread is detached,
and preserv attached the thread if they want to be able to interrupt it,
isn't it?

Regards

Vicente


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