Boost logo

Boost :

Subject: Re: [boost] [context] ready
From: Oliver Kowalke (oliver.kowalke_at_[hidden])
Date: 2011-11-09 03:25:52


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

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

> 2) Many functions seem unnecessarily virtual, IMO, only dtor and exec need
> to be virtual.
> icontext could be replaced with platform-specific context_base
> without Allocator stored, and you could store Allocator in context_object
> instead, passing it to templated methods of context_base when needed (e.g.
> on constructon & cleanup).

boost::context should be independed from the used Allocator. That requires that the pointer to the impl held inside boost::context doesn't contain the allocator type in its class declaration. Thatswhy icontext was introduced.
context_base uses the allocator in order to allocate/deallocate the stack as well aplly it to fcontext_t.

But maybe you can send me your solution so I can take alook at it?

Oliver

-- 
Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de

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