[Mono-dev] Threads sleeping forever

Dennis White Dennis.White at lfg-usa.com
Tue Jul 5 12:32:14 EDT 2011


Personally I am not a big fan of Thread.Sleep(#)...

 

Have you tried using an event??  I would give a ManualResetEvent a try
and in the WaitOne(#) method call pass in a valid timer that your
function can block on. Based on the questions and responses coming back
though it seems like something else is happening and your thread context
is successful at exposing flaws related to it. 

 

Dennis 

 

From: mono-devel-list-bounces at lists.ximian.com
[mailto:mono-devel-list-bounces at lists.ximian.com] On Behalf Of Tom Spink
Sent: Tuesday, July 05, 2011 8:43 AM
To: Darkiwi
Cc: mono-devel-list at lists.ximian.com
Subject: Re: [Mono-dev] Threads sleeping forever

 

On 5 July 2011 16:28, Darkiwi <pitikiwi_001 at hotmail.com> wrote:

@Tom:
Yes, as my test is running, it updates the UI. The events are sent into
a
fifo which is depiled in the main thread's Application.Idle to avoid
invoke
problems.
If I remember well, I also tried commenting this but it did not solve my
problem :-(
I will run this test again, just to be sure.

 

Interesting - is it a lot of updates you're doing, via Application.Idle?
You might consider reworking your updates to using BeginInvoke and/or
Invoke to see if it's a problem with your Application.Idle approach.

 

Of course, if you disable any updating of the UI and you're still in
trouble, then it's unlikely that it's a problem with your UI update
marshalling code.

 

However, thinking about what you've said - how are you synchronising the
UI update queue?  You said you're pushing events into a FIFO - how is
that FIFO producer synchronised, WRT the Application.Idle consumer?


-- Tom

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20110705/723912bc/attachment-0001.html 


More information about the Mono-devel-list mailing list