Boost logo

Boost :

Subject: Re: [boost] [thread] terminating destructor
From: Andrzej Krzemienski (akrzemi1_at_[hidden])
Date: 2012-10-25 05:13:10

2012/10/23 Vicente J. Botet Escriba <vicente.botet_at_[hidden]>

>> Hi,
> I have created two tickets to track this possible additions:
> Add a helper class that interrupts a thread and join it on destruction
> Add a thread wrapper class that interrupts and join on destruction
> While the scoped_thread class defined in C++ Concurrency in Action is a
> strict scoped class that doesn't allows any change in the wrapped thread, I
> think that making the interface thread compatible is also a good option.
> This doesn't means that a strict scoped thread has no use.

Hi Vicente,
The description in the two tickets above do not mention any interruption.
thread_guard and scoped_thread only join w/o interruption. Do you intend
both to interrupt before join?

If "yes", will the names of the two would not be confusing? Name
"scoped_thread" is likely (IMHO) to be interpreted that we want to finish
for the thread to end in a normal (non-interrupted) way. Perhaps the name
should indicate that we want an interruption.

If "no", is scoped_thread different from the functionality offered by
async? (Given that future's destructor blocks.)


Boost list run by bdawes at, gregod at, cpdaniel at, john at