I'm wondering if it's possible to activate multiple Mono domains and execute them in 开发者_如何学Cparallel 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);
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.
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
精彩评论