Hi folks,
I am working on an app that needs to do heavy work in the background. I use
RunOnGuiThread to update the UI with progress and results. The problem is,
that I am experiencing non-deterministic hangups. When hanging I pause the
debugger and I always see that the executing thread (mostly my code on the
GUI thread) hangs in some random method (like view.GetChildAt(i) or
view.LayoutParameters=) or sometimes also not in my code. The stacktrace of
the hanging thread always looks like this 

System.Threading.Monitor.TryEnter ...
System.Threading.Monitor.Enter ...
Java.Lang.Object.GetObject ...
Java.Lang.Object._GetObject
Java.Lang.Object.GetObject ...
...

and another thread is waiting in System.Threading.Waithandle.WaitOne but I
have no code location. 

This happens even though I got no locks in my code but the deadlock happens
more likely if I do some locking of my own. To run the background worker I
tried System.Threading.ThreadPool, System.Threading.Thread and also
AsyncTask. It seemed to hang slightly more often with AsyncTask.

Because of the random nature of the deadlock and the absense of locks in my
code I suspect that the reason must be some synchronization in the
transition from c# to java and vice-versa. 

What do you think about that theory? Is there a way of proving/refuting
this? What can be done to eliminate such a deadlock?

If you need more info, please tell me what exactly I should provide.

Best regards,
-- henon

--
View this message in context: 
http://mono-for-android.1047100.n5.nabble.com/Random-Deadlock-tp5710849.html
Sent from the Mono for Android mailing list archive at Nabble.com.
_______________________________________________
Monodroid mailing list
Monodroid@lists.ximian.com

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid

Reply via email to