[Mono-dev] Multiple Monos in a single process

Robert Jordan robertj at gmx.net
Tue Sep 13 05:53:07 EDT 2011


On 12.09.2011 22:23, Joe Dluzen wrote:
> Hi all,
>
> let's say I have a C# app A which PInvokes to a native SO/DLL B, which
> embeds Mono for basically 100% of its logic. Do bad things happen on
> Linux vs Windows?

Yes. Under Linux, libmono is statically linked by default.
If you p/invoke a library that it turn is linked against
libmono, you'll end up with 2 runtime instances.

Even if you link libmono dynamically (there is a `configure'
switch for this), you must take care to initialize the runtime
only once. This means that you can't call mono_jit_init/cleanup
from the SO.

Robert



More information about the Mono-devel-list mailing list