Hello all,I'm having 2 threads in an console application, each one using the same resource object so I lock an object so they can each do their work. This all fine. Now I try to implement a way to stop/join/kill those threads.I still don't understand the diff between stop and join.My threads both uses an AutoResetEvent declared as:private static AutoResetEvent threadWait = new AutoResetEvent(false);
private static AutoResetEvent threadWaitCleanup = new AutoResetEvent(false);And used as :while (mainLoop && !threadWait.WaitOne(Config.SleepTimeFtpThread))
} I tried to call the Set() method of both AutoResetEvents thinking it will stop the threads when there job done. In fact while debugging I saw that a thead was not running anymore when it was done and entered the while loop again. But It was not safe to quit the application untill that job was done and it was not realy the case. So it could be the process is still inserting records , the user quits the app while its inserting could result in a bad result.Do I here have to use abort, stop, join ?
View Complete Post