
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.
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