Boost logo

Boost :

Subject: Re: [boost] [threadpool] new version v12
From: Giovanni Piero Deretta (gpderetta_at_[hidden])
Date: 2008-11-03 09:30:35


On Mon, Nov 3, 2008 at 3:17 PM, Anthony Williams <anthony.ajw_at_[hidden]> wrote:
> "Peter Dimov" <pdimov_at_[hidden]> writes:
>
>> Anthony Williams:
>>> future<T> some_future;
>>>
>>> try
>>> {
>>> throw my_exception();
>>> }catch(...)
>>> {
>>> some_future.wait(); // may invoke task from pool if some_future
>>> // not ready
>>> throw; // oops, where's my exception state gone?
>>> }
>>
>> Are you sure that the above doesn't work?
>>
>> try
>> {
>> throw my_exception();
>> }
>> catch(...)
>> {
>> try
>> {
>> call_function_that_throws();
>> }
>> catch( ... )
>> {
>> }
>>
>> throw; // works
>> }
>
> No, I'm not sure, but if some_future.wait() switches to a new fiber I
> am concerned that it won't, because the exception state is per-thread,
> not per-fiber.
>

This can be dealt with on all ABIs I know of (which admitedly isn't
many: gcc with Itanium Abi has no problem, while Win32 fibers take
care of it; older gcc ABIs may need help, but is doable).

-- 
gpd

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