[Mono-dev] Monoco, couroutines and Mono.

Rodrigo Kumpera kumpera at gmail.com
Wed Apr 15 15:48:09 EDT 2009


Hi James,

On Wed, Apr 15, 2009 at 4:17 PM, James Mansion <james at mansionfamily.plus.com
> wrote:

> Tomi Valkeinen wrote:
> > I think you mean OS thread. The coroutines are nothing special, they
> > are similar to any other jitted code that mono produces.
> Well, except that the core has some knowledge of them now, right?
> > And thus the stack has to be the normal continuous OS stack.
> Thus?  Why? You probably need to pin stack areas, but why can't you
> malloc (or mmap) some new space
> and place a stack in it?  I think you'll find that Steve Dekorte's
> libcoro does that. If you are prepared to
> forgo guard pages and the like (or roll your own handler) then I don't
> see why the stack pointer absolutely
> has to be where you expect.  And in fact the gubbins that normally gets
> pushed to the main CPU stack
> can get pushed to a fully software stack anyway, just as you do on RISC
> systems with no push/pop
> abstraction.  The stack pointer is just a pointer, after all.
>
> James
>

Such stackless[1] design is quite more complicated as doing stack
attach/detach
isn't trivial. Spaghetti stacks have their issues that this design avoids.

The good news is that such change would not require messing with the API, so
if this feature
gets enough traction and someone from the community decides to sponsor such
optimization
it would be doable without breaking existing users.

[1]stackless in the sense that it doesn't strictly use the C stack
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20090415/9db9257a/attachment.html 


More information about the Mono-devel-list mailing list