[Mono-devel-list] Saving And Loading Stacks (Embedding Mono in a Virtual World)

Jim Purbrick jimpurbrick at yahoo.co.uk
Mon Mar 21 13:05:29 EST 2005


--- Jim Purbrick <jimpurbrick at yahoo.co.uk> wrote:
> --- Willibald Krenn <Willibald.Krenn at gmx.at> wrote:
> > > Is it possible to save and load mono stacks? 
> >
> > I don't think this will work. You'd have to
> > guarantee that all code (JIT compiled methods) is 
> > at the same place, the methods are actually 
> > compiled, all VMTs are correctly initialized, ... 
> 
> Hmm. I was hoping that I'd be able to store the
> stack in terms of CIL methods and offsets, then 
> rebuild it at the other end.

I've had a play with the stack walking code, which
gets me the IP and methods on the stack, but looks
like I effectively need to decompile the native code
back in to CIL to recover the locals and arguments.

> Couldn't it be made to work in a similar way to a 
> debugger?

I still need to look at exactly what the debugger can
and can't do, it may be extracting all the information
I need from the native stacks and will hopefully give
me some clues as to how to manipulate the stack in
order to load it at the other end.

> If code locations and and ensuring compilation are a
> problem, could I compile ahead of time and ship the
> binary around between servers?

This looks like it might be easier, just to deal with
native code and native stacks, rather than try to
transfer CIL stacks, but I'm not sure just tranferring
the JIT output and native stack would be enough.

Alternatively building continuations on the heap and
doing saving and loading in bytecode like PicoThreads
or JavaGoX might be the way to go after all...

Cheers,

Jim.

Send instant messages to your online friends http://uk.messenger.yahoo.com 



More information about the Mono-devel-list mailing list