7

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);
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Ghassen Hamrouni
  • 3,138
  • 2
  • 20
  • 31

2 Answers2

1

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

sehe
  • 374,641
  • 47
  • 450
  • 633
1

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.

Marc
  • 4,546
  • 2
  • 29
  • 45