[Mono-devel-list] embeded mono and Thread.CurrentThread

eric lindvall eric at 5stops.com
Sat Jul 5 23:43:00 EDT 2003


other than using mono_runtime_exec_managed_code(), what other requirements
are there for embedding mono?

if i call mono_jit_init() on a thread, do i just need to call
mono_runtime_exec_managed_code() once, and then call mono_thread_attach()
on any pthread created thread i want to access mono from?

does the function that i called mono_runtime_exec_managed_code() from need
to not exit?

is this all written up somewhere?

there seems to be a lot missing from the embedded-api.html (like the need
to call mono_runtime_exec_managed_code()).

thanks.

e.


On Wed, 02 Jul 2003, Paolo Molaro wrote:

> > int main (int argc, char **argv)
> > {
> >     MonoDomain *domain;
> >     MonoAssembly *assembly;
> >     MonoMethodDesc *methodDesc;
> >     MonoMethod *method;
> >     MonoObject *object;
> >     MonoException *ex = NULL;
> >     gpointer params[1];
> > 
> >     char *res;
> > 
> >     domain = mono_jit_init (argv[0]);
> > 
> >     mono_debug_init (MONO_DEBUG_FORMAT_MONO);
> > 
> >     assembly = mono_domain_assembly_open (domain, "/home/eric/src/oxide/oxide.dll");
> >     
> >     mono_debug_init_2 (assembly);
> > 
> >     methodDesc = mono_method_desc_new ("Fivestops.Oxide.OxideHelper:ProcessPage", TRUE);
> >     method = mono_method_desc_search_in_image (methodDesc, assembly->image);
> > 
> >     params[0] = mono_string_new (domain, "index.aspx");
> > 
> >     /* object = mono_runtime_invoke (method, NULL, params, (MonoObject **) &ex); */
> >     object = mono_runtime_invoke (method, NULL, params, NULL);
> 
> You currently need to run managed code in it's own subthread, see mono/samples/embed/teste.c
> 
> lupus
> 



More information about the Mono-devel-list mailing list