Threading
-
I am trying to teach myself threading from a book, but the book I have isn't helping me very much. My main thread sends off another thread. The new thread could at any given moment be either running or suspended. I want to be able to abort that thread and creat it again so that it starts at the begining of its process. The problem I am having is that depending upon whatever random moment I click the button that does this; I sometimes get either a ThreadAbortException or a ThreadStateException. For some reason my try--catch isn't catching them. I don't suppose anyone would be able to give me a little example of how to work with threads in this way????? Thanks, Jody Blau
-
I am trying to teach myself threading from a book, but the book I have isn't helping me very much. My main thread sends off another thread. The new thread could at any given moment be either running or suspended. I want to be able to abort that thread and creat it again so that it starts at the begining of its process. The problem I am having is that depending upon whatever random moment I click the button that does this; I sometimes get either a ThreadAbortException or a ThreadStateException. For some reason my try--catch isn't catching them. I don't suppose anyone would be able to give me a little example of how to work with threads in this way????? Thanks, Jody Blau
Try this: Catch ex As ThreadAbortException Trace.WriteLine("READ THREAD ABORT EXCEPTION!") 'Allow the thread to continue aborting: Thread.ResetAbort() david