From: Giovanni P. Deretta (gpderetta_at_[hidden])
Date: 2006-04-28 13:36:17
Alexey Trenikhin wrote:
> When pth switched user context it did not switch exception handlers. For
> Coroutine A:
> throw 1;
> printf("catched in A")
> Coroutine B:
> printf("catched in B")
> create_A(); create_B(); switch_toA();
> result: catched in B
I've ran almost the same test using my library and it seems to do the
right thing. I can't try Pth right now, but i suspect it would work too,
as both libraries are similar.
I'm running gcc 3.3.6 under slackware-current.
As gcc exception model has not changed since 3.0 (or so), i think that
the problem is the platform: I'm not sure, but i think that gcc on
windows uses a different system to handle exceptions, putting exception
handler data on the stack (to be compatible with other win compilers and
the OS itself), while on linux, and maybe other OSes, it uses a
different method that need no stack data and only relies on the
instruction pointer and registers value (the zero overhead exception
I might be wrong, but i cannot think of anything else.
I'll investigate more later.
-- Giovanni P. Deretta
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk