Re: Simple race condition that I can't solve.

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Cool Guy <coolguy@xxxxxxx> wrote:

> Today I found that an app I'm working on has a race condition. I've been
> trying to solve this for ages and I have no idea. Going outta my mind
> here.

Here's more info...

I set /closed/ to true in the main thread, and expect the event handler
(worker_Finished) to then *not* try to call HandleFinished on the main
thread. However, it ends up that it *does* call it.

The call to Thread.Sleep() in the main thread is there just to ensure that
the race condition happens (otherwise, it'll happen every so often, I
believe).
.



Relevant Pages

  • Re: Console app freezes
    ... race condition cause a hang? ... I'm getting quite worried because i have been working on this app for quite ... > multithreaded applications to hang. ... the system time at the bottom right corner also freezes). ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: Bug with Socket
    ... I use Microsoft Winsock Control, and I have code in the event handler. ... My app is sending little dates but very often. ... Prev by Date: ...
    (microsoft.public.vb.bugs)
  • Re: a synchronization issue - jusy for you guys
    ... >> of app only. ... > Nice race condition. ... reducing the incidence of thread conflict to an unnoticeable level. ...
    (comp.lang.pascal.delphi.misc)
  • pthread_join(): any way to limit how long it waits for?
    ... Will there be a race condition if the thread hangs before exiting: ... pthread_joinwait forever? ... Simon Elliott http://www.ctsn.co.uk ... Prev by Date: ...
    (comp.unix.programmer)
  • Re: pthread_join(): any way to limit how long it waits for?
    ... Simon Elliott wrote: ... No race condition. ... terminates, so that you can wait on the condition for a specified ... Prev by Date: ...
    (comp.unix.programmer)