Boost logo

Boost :

Subject: Re: [boost] [Review] Coroutine : Christopher's Review
From: Oliver Kowalke (oliver.kowalke_at_[hidden])
Date: 2012-09-06 15:01:35

Hello Christopher,

thank you for your review

Am 06.09.2012 20:38, schrieb Christopher Kormanyos:
> 1) The code may potentially benefit from some clean-up.
> In particular, there is a mixture of tabs and spaces in the code,
> possibly resulting from programming over two or more time
> epochs with different styles. A simple reformat will clean this up.
OK - forgot to activate my vim scripts - I'll fix this soon

> 2) There should be, let's say, a *lightweight* version
> (or configuration) of Coroutine for embedded systems

> 3) The lightweight version can not use the non-placement
> version of new(). The internal details of a coroutine are stored
> in the class as a pointer created with non-placement new().
> The lightweight version could add a parameter for user-supplied
> memory and create the coroutine implementation details
> with placement-new().
Vicente suggested to add an allocator handles allocation of the internal
class - I think it ill address this issue.

> 4) Furthermore, the lightweight version should not
> not use any exceptions whatsoever. I spent two solid
> hours removing all traces of exceptions while embedding
> Coroutine. The result was a lightweight mechanism
> that only costed a few kilobytes of program code.
Some of the exceptions are replaced by assertions (pre-conditions) - one
exception 'stack_unwind' is required in order to unwind the stack. The
question is how to unwind the stack without throwing exceptions. Of
course there is the Itanium unwind API but not all compiler provide it
(gcc does, pgi not). At least exceptions are thrown by
BOOT_THROW_EXCPETION macro - you can disable it with a compiler flag.

> 5) We need to work together to create more contexts
> for different CPU architectures. The ARM(R) context that is
> present in Boost.Context uses several ASM operations that
> my ARM(R) Cortex(R)-M3 does not support. For this
> reason, I could not complete my benchmark.
> We can work on this in the future.
OK - let my know which instructions are not available on Cortex-M (but
it is an issue of boost.context).
The usage of main stack pointer/process stack pointer could add some
benefits too.


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