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

Paolo Molaro lupus at ximian.com
Tue Jan 25 08:34:33 EST 2005


On 01/24/05 Jim Purbrick wrote:
> The hope is that Mono's JIT compilation will provide a
> large performance boost over the current script

If the same scripts are run multiple times I'd expect
a large performance improvement.

> So, the 2 big jobs are to embed Mono in to the virtual
> world in such a way that we can run 1000s of scripts
> concurrently and to develop a compiler which compiles
> our current scripting language to CIL.
> 
> Does this sound feasible? If so, what is the best

It depends what are your requirements for 1000s of
concurrent scripts. Creating 1000s of threads is not an option,
since it would use too many resources (and last I checked the 
io-layer imposes a limit at about 1000 threads: hopefully this
will be fixed shortly) even if you use the newly implemented
API to specify a small stack size for the new threads.
So it very much depends on what is the behaviour of the scripts:
you might want to have your system use the threadpool.
This way you'll have a limited number of threads (by default
25 for cpu, I think, but it's configurable) that will execute
the scripts asynchronously. This works if the scripts are
supposed to be short-lived.

> approach be? I've had a thorough look through the list
> archives but haven't found many CIL compiler resources

You can look at the IronPython, Boo, or a number of
other compilers that either emit IL code or use Reflection.Emit.

> or posts about using embedded Mono to provide this
> level of concurrency in a semi-realtime environment.

If the threadpool suits your needs, there is nothing
specific about embedded Mono to it: you just write the
C# code that uses the threadpool.

lupus

-- 
-----------------------------------------------------------------
lupus at debian.org                                     debian/rules
lupus at ximian.com                             Monkeys do it better



More information about the Mono-devel-list mailing list