Hi Peter, First, you do know the ThreadPool?
Its QueueUserWorkItem can let you do some work without the need of creating or deleting threads on your own. Second, I cannot replay what you are seeing, when I create the threads and start them I see the threadcount increasing in taskman, aborting them or just let them finish, decreases the threadcount... (Though I tested it with 2.0, i cant imaging something fundamental as threading has changed from 1.1 to 2.0...) Why is there a need to abort your threads? You say you are waiting for an event, can you let them wait for an "abort" event, and when that event occurs the thread just exits its runloop, which will destroy the thread by it own. HTH // Ryan On 9/5/06, peter lin <[EMAIL PROTECTED]> wrote:
Dear all, I create a thread and call its start method, after some times pass, I make it wait for a event and block itself, then I call thread's abort method. I found my thread count(viewed by process explorer) is still the number before I call abort. I search it from lots of donet books. The only way I can do is calling abort or call a flag and blah... My situation is like as follows. I have a multithread application using dotnet 1.1.One of the threads hang I don't when it will cause this problem. So I guess I need to write a monitor thread to monitor all the threads. Once thread hang, I can call the thread's abort function and recreate a thread with the same properties to do its job. I found the thread count increasing . I just don't know why the thread count not decrease when the monitor call the thread's abort function? Could someone tell me how to do this? Best regards Peter =================================== This list is hosted by DevelopMentor(r) http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com
=================================== This list is hosted by DevelopMentorĀ® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com