Boost logo

Boost :

Subject: Re: [boost] [threadpool] new version v12
From: Anthony Williams (anthony.ajw_at_[hidden])
Date: 2008-11-03 09:37:13


"Giovanni Piero Deretta" <gpderetta_at_[hidden]> writes:

> 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.
>>
>
> Win32 fibers take care of it;

AFAIK, only on Vista. I'd be glad to know I was mistaken.

Anthony

-- 
Anthony Williams
Author of C++ Concurrency in Action | http://www.manning.com/williams
Custom Software Development | http://www.justsoftwaresolutions.co.uk
Just Software Solutions Ltd, Registered in England, Company Number 5478976.
Registered Office: 15 Carrallack Mews, St Just, Cornwall, TR19 7UL, UK

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