Problem with the nonresponding threads

Posted by Oxygen on Stack Overflow See other posts from Stack Overflow or by Oxygen
Published on 2010-04-02T16:24:54Z Indexed on 2010/04/05 0:13 UTC
Read the original article Hit count: 685

Filed under:
|
|

Hello there,

I have a web application which runs multiple threads on button click each thread making IO call on different ipAddresses ie(login windows account and then making file operations). There is a treshold value of 30 seconds. I assume that while login attempt if the treshold is exceeded, device on ipAddress does not match my conditions thus I dont care it. Thread.Abort() does not fit my situation where it waits for the IO call to finish which might take long time.

I tried doing the db operations acording to states of the threads right after the treshold timeout. It worked fine but when I checked out the log file, I noticed that the thread.IsAlive property of the nonresponding threads were still true. After several debuggings on my local pc, I encountered a possible deadlock situation (which i suspect) that my pc crashed badly.

In short, do you have any idea about killing (forcefully) nonresponding threads (waiting for the IO opreation) right after the execution of the button_click?

(PS: I am not using the threadpool)

Oguzhan

© Stack Overflow or respective owner

Related posts about c#

Related posts about multithreading