Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

(Embedding Mono) Parallel activation of domains

I'm wondering if it's possible to activate multiple Mono domains and execute them in parallel from native code:

I use the following code to activate a domain:

///Create a new domain.
m_domain = mono_domain_create();

///Activate the domain.
mono_domain_set(m_domain, 0);
///Invoke some function ...
mono_runtime_invoke (m_method, m_objectInstance, NULL, &exception);
like image 623
Ghassen Hamrouni Avatar asked Apr 13 '11 08:04

Ghassen Hamrouni


2 Answers

Yes this can be done. Given that the Mono virtual executable runs alongside your C application when it's embedded (and shares the same address space), The best approach would be to launch each domain in a separate process. The easiest way to do this would be to have your code fork multiple processes and each process would manage a separate Mono domain instance. You'd have to write some code to coordinate interprocess communications, particularly application clean-up and shutdown.

like image 183
Marc Avatar answered Oct 14 '22 02:10

Marc


From the .NET perspective I'd say: yes

The internet archives were able to get this once-ubiquitous resource back:

http://replay.waybackmachine.org/20070228090021/http://www.gotdotnet.com/team/clr/AppdomainFAQ.aspx

like image 21
sehe Avatar answered Oct 14 '22 01:10

sehe