[Mono-dev] Embedded Mono/Program freezes

Janne Rantala janne.rantala at gmail.com
Sat Aug 19 12:59:35 EDT 2006


2006/8/19, Robert Jordan <robertj at gmx.net>:
> Janne Rantala wrote:
> > 2006/8/19, Robert Jordan <robertj at gmx.net>:
> >> You wrote that you're using mono_runtime_exec_managed_code ().
> >> If I understand the code correctly, the function will shutdown
> >> the runtime after the callback terminates. That's probably not
> >> what you expect, isn't it?
> >>
> >> Try mono_thread_attach () instead of *_exec_managed_code ().
> >> Note that runtime must reside in a DLL, otherwise
> >> mono_thread_attach () would fail under Windows.
> >>
> >> Robert
> >>
> >
> > If I do that, I get "Fatal error in gc, collecting from unknown
> > thread" -error when executing managed code.
>
> I just had a look at libmono's VS.NET project file
>
> libmono.vcproj:
>
> PreprocessorDefinitions="... GC_NOT_DLL ..."
>
> GC_NOT_DLL prevents libgc from being able to attach to
> foreign threads.
>
> Try to remove this define.
>
> libgc.vcproj also defines GC_NOT_DLL. This must be removed
> as well.
>
>
> Robert
>

I'm embedding Mono at runtime so I build Mono with Cygwin and use it
from mono-1.dll. I once tried building it with VS2005 but found that
it's easier this way.

You said earlier that mono_runtime_exec_managed_code also shuts down
the runtime, even if it does that, is it a problem in my case? Because
when I run that program two times everything still works fine but I
get that "The request timed out". Is it because that runtime shutdown
or something else?

Janne



More information about the Mono-devel-list mailing list