|
Boost : |
Subject: Re: [boost] [threadpool] new version v12
From: Giovanni Piero Deretta (gpderetta_at_[hidden])
Date: 2008-11-03 10:04:51
On Mon, Nov 3, 2008 at 3:37 PM, Anthony Williams <anthony.ajw_at_[hidden]> wrote:
> "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.
>
I know that Vista changed the exception handling behavior, but I'm
fairly sure that fibers should correctly switch context state
correctly. Oddly I can't find any detailed description on the 'net (It
has been a long time...). I'll have to do a more accurate search, but
I do not have time right now. Do you have any proof of the contrary?
What I'm sure you cannot do is catching exceptions *across* fibers.
Everything else should work fine.
-- gpd
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk