[Mono-dev] Embedded Mono/Program freezes
robertj at gmx.net
Sat Aug 19 20:21:27 EDT 2006
Janne Rantala wrote:
> 2006/8/19, Robert Jordan <robertj at gmx.net>:
>> Janne Rantala wrote:
>>> 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
>> I said: if I understand the code correctly. There is definitely
>> some clean up code involved.
>>> 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?
>> Last time you wrote that the second request is timing out.
>> If the third is timing out, we are back to the first
>> guess: the socket connection to the web server is remaining open.
>> Try this:
>> System.Net.ServicePointManager.DefaultConnectionLimit = 10;
>> If you can connect 10 times now, then mono_runtime_exec_managed_code
>> is somehow preventing the sockets from being cleaned up.
> Looks like I can run that same program as many times as I want if I do
> all those calls to managed code inside same
> mono_runtime_exec_managed_code. Seems that it may have something to do
> with runtime shutting down after all?
I can reproduce it. The socket connection to the web server
hosting the web service remains open after the first
mono_runtime_exec_managed_code terminates and the second
run freezes the process.
If I use mono_thread_attach, everything works as expected.
You should really try to get mono_thread_attach running,
because mono_runtime_exec_managed_code looks deprecated.
How do you load mono-1.dll? LoadLibrary? If so, when?
If you don't load it right after the process starts,
the GC will miss all threads that have been created
in the meanwhile.
More information about the Mono-devel-list