Boost logo

Boost :

Subject: Re: [boost] review request for boost.context
From: Oliver Kowalke (k-oli_at_[hidden])
Date: 2010-07-28 14:41:51


Am 28.07.2010 20:28, schrieb Emil Dotchevski:
> On Wed, Jul 28, 2010 at 7:08 AM, Oliver Kowalke<k-oli_at_[hidden]> wrote:
>>> How does it behave under c++ exceptions?
>>
>> Exceptions must catched inside the function invoked by boost::context - if
>> not sj/lj exception model is used (DWARF instead) -> see docu.
>
> Wouldn't it be nicer if the framework catches exceptions from the
> functions and then propagates them to the caller from jump_to() or a
> special function exception_ptr get_error()?

No, because boost.context behaves like POSIX ucontext. The app exits if
the function executed by the context ends.
You could 'link' to another context which will be executed after
finishing up the function.

What you suggest should be part of higher levels - you could find such
exception passing in boost.fiber which uses a future object for this
purpose.

Oliver


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk