Boost logo

Boost :

Subject: Re: [boost] [context] ready
From: Giovanni Piero Deretta (gpderetta_at_[hidden])
Date: 2011-11-09 09:45:41

On Wed, Nov 9, 2011 at 9:36 AM, TONGARI <tongari95_at_[hidden]> wrote:
> 2011/11/9 Oliver Kowalke <oliver.kowalke_at_[hidden]>
>> > Your work is appreciated, and I really want to try it, unfortunately it
>> > doesn't support MinGW yet.
>> maybe MinGW is supported later (requires only to adapt the Windows asm to
>> GAS style + entry in Jamfile).
> Actually I've tried some MASM/GAS convert tools but with no luck :/

wasn't it possible to get GAS to swallow intel style asm?

>> > 1) The doc says suspend() throws nothing, but it does throw
>> > ex_unwind_stack for unwinding.
>> > Maybe it'd be better to make ex_unwind_stack part of API, and let the
>> > user catch and rethrow.
>> ex_unwind_stack is swallowed by boost::context - it is required in order
>> to implement expilict stack unwinding.
>> It is important that the user dosn't swallow this exception!
>> I think the best would be that the user dosn't know the type of this
>> exception (unnamed exception?) - not sure if I should supress this info or
>> note it explicitly in the docu.
> Indeed the user should not swallow it, but there's no reason to prohibit
> the user from using catch(...) as well, so why not let the user catch and
> rethrow ex_unwind_stack explicitly for stack unwinding?

It is technically possible to create an un-swallowable exception by
retrowing '*this' in the exception destructor. IIRC g++ does exactly
this for thread cancellation.

I do not recomend this solution, though, as normally code does not
expect it. I thik that the best thing to do woud be to document that
the exception should be eventually rethrown at some point (not
necessarily inside the catch(...) before resuming the calling (i.e.
suspend()) context. suspend() should assert that the context has
actually unwound.


Boost list run by bdawes at, gregod at, cpdaniel at, john at