[Mono-devel-list] Embedding Mono in a Virtual World

Jim Purbrick jimpurbrick at yahoo.co.uk
Wed Jan 26 18:17:53 EST 2005

 --- Paolo Molaro <lupus at ximian.com> wrote: 
> I think you have two options:
> *) inject code into the scripts to make them state
> machines that will periodically check the timeout 
> info and save the state to an object and reload it 
> when it's restarted, similar to how the C#
> compiler handles the yield construct.

This is a possibility as we have to write a compiler
for the scripting language anyway, but it would
complicate the compiler and make the future use of
other languages much more difficult. I suppose
theoretically we could write a tool which analysed CIL
and injected the code in to the output of any CIL
compiler allowing language inter-operation, but that
is even more hairy. On the plus side, this approach
could me made to work a lot like the current system
and so minimise changes outside the scripting engine.

> *) use the threadpool as initially suggested: you
> will queue all the scripts for execution. 

Would you queue the scripts themselves and allow them
to wait on events for much of the time, or queue the
events themselves and switch script state manually?

> If a scripts takes lots of time to run, the other 
> scripts will be queued to other threads: since this 
> should happen rarely it should not be a problem, 
> unless you also need to guarantee against denial of 
> service attempts.

Would it be possible to use another thread to watch
for scripts which are performing denial of service
attacks and terminate their execution?

> Note that this means that the scripts will run 
> concurrently.

Yes, which means that it may require lots of changes
to the rest of the system to support calls from
multiple threads.

ALL-NEW Yahoo! Messenger - all new features - even more fun! http://uk.messenger.yahoo.com

More information about the Mono-devel-list mailing list