[Mono-dev] Monoco, couroutines and Mono.
tomba at iki.fi
Wed Apr 15 02:37:19 EDT 2009
On Tue, 14 Apr 2009, James Mansion wrote:
> Tomi Valkeinen wrote:
>> And I'm still of the opinnion that this stack-copying is more of an
>> interesting hack, than something people should really use =).
> Is there a real cast-in-stone reason why a VM engine has to have a contiguous
> stack at the
> point where a hardware thread calls into the coroutine scheduler and is
> scheduled onto
> a coroutine?
I think you mean OS thread. The coroutines are nothing special, they are
similar to any other jitted code that mono produces. And thus the stack
has to be the normal continuous OS stack.
I believe it could be possible to rewrite the whole jit code generation to
produce code that doesn't use stack but position independent frames, and
then these frames could be used to create much faster continuations
without any copying (like stackless python). But this would mean that the
frame could not grow dynamically, and I bet there are other limitations
which makes this solution not compatible with how CLI is supposed to work.
And it would be a huge job =).
More information about the Mono-devel-list