[Mono-list] Mono embedding with threads + multiple domains

Roberto De Ioris roberto at unbit.it
Thu Feb 28 15:22:37 UTC 2013

(sorry forget to forward to the list)

> On 28.02.2013 10:15, Roberto De Ioris wrote:
>> Hi everyone, i am writing a uWSGI plugin for Mono
>> https://github.com/unbit/uwsgi/tree/master/plugins/mono
>> the plugin is already in good shape but now i would like to add
multi-domains support (currently you can load multiple applications but
all in the same mono domain)
> ApplicationHost.CreateApplicationHost is already creating its
> own app domain.

> I did not test your code, but it looks like you don't take
> this into account. All icalls seem to allocate objects from
> the main app domain, but you're expected to allocate them
> in the current domain (see mono_domain_get ()).

Absolutely, i was sure i need to manually manage domains.

So, when i create a new ApplicationHost with


i am effectively creating a new domain and when i call


i am effectively moving to the corresponding domain.

Right ?

If it is right how i need to register my pthreads in the multi-domain
system ? Currently (as you have noted) i attach pthreads (to the main
domain) when they start.

>> Albeit it should be simple, i have seen various notes regarding
multithreading+multidomain as a no-go.
> Where did you see these notes?

effectively on an old thread of 2003 on the mono-devel list (sorry i did
not notice the year)

Roberto De Ioris

More information about the Mono-list mailing list