
On Mon, Nov 3, 2008 at 3:37 PM, Anthony Williams <anthony.ajw@gmail.com> wrote:
"Giovanni Piero Deretta" <gpderetta@gmail.com> writes:
On Mon, Nov 3, 2008 at 3:17 PM, Anthony Williams <anthony.ajw@gmail.com> wrote:
"Peter Dimov" <pdimov@pdimov.com> 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