I have a multithread application: a Master and several Workers. They each have a while(true) loop to do their thing.
The Master enqueues an integer in a shared queue. The Worker dequeues an integer if there is one there. I use Thread.Sleep(1) in the Master as a loop governor. I use a ManualResetEvent workToDoEvent for the workers to check and block on: "if (workToDoEvent(10, false)" -- the 10ms being the Worker's loop governor. After a period of enqueueing and dequeueing my Workeres seem to dissapear without a trace -- no exceptions and no output to the common ListBox(where I display what is happening). I'm clueless. Thanks, Mark
The Master enqueues an integer in a shared queue. The Worker dequeues an integer if there is one there. I use Thread.Sleep(1) in the Master as a loop governor. I use a ManualResetEvent workToDoEvent for the workers to check and block on: "if (workToDoEvent(10, false)" -- the 10ms being the Worker's loop governor. After a period of enqueueing and dequeueing my Workeres seem to dissapear without a trace -- no exceptions and no output to the common ListBox(where I display what is happening). I'm clueless. Thanks, Mark