avissa

avissa

  • NA
  • 3
  • 0

difference b/w ManualResetEvent's object.waitone and Thread.currentthread.suspend

May 25 2004 8:59 AM
hi, can anyone tell me what's the difference between the "ManualResetEvent's object.waitone" and "Thread.currentthread.suspend",because both the statements are performing the same operation (i.e, block the current thread) or is there any other difference? this is the example that i have tried in vb.net Dim _paused As ManualResetEvent Dim _thread As Thread Dim _threadStart As ThreadStart _paused = new ManualResetEvent(false) _threadStart = new threadStart(some_function_name) _thread = new thread(_threadStart) _thread.start() console.writeline("the thread has started") _paused.waitone 'this statement takes the thread into wait state and the below statement does not execute '_thread.currentthread.suspend 'this statement also does the same thing as the above stmt console.writeline("the thread is paused") Thanks in advance