[Mono-dev] Monoco, couroutines and Mono.

James Mansion james at mansionfamily.plus.com
Wed Apr 15 15:17:42 EDT 2009


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



More information about the Mono-devel-list mailing list