> I can hardly imagine the multi-threaded architecture which will be able to recover from the situation when one of its threads was killed by TerminateThread.
They exist. They require extensive resource tracking to implement, but they exist. And I’m talking about commercial mainframe OS, not a toy for the inside of a laser printer.
No, it is NOT easy to do. It may be impossible where there can be 3rd party kernel software, such as in NT, since all threads have to follow the rules. Which means that the rules must be known! (And yes, even in this case there are a very few instances where a reboot is the answer. But it will be a more complex case than a device driver mucking itself up, or a minor peripheral failing.)
Loren
----- Original Message -----
From: Maxim S. Shatskih
To: Windows System Software Devs Interest List
Sent: Thursday, January 29, 2004 12:27 PM
Subject: Re: [ntdev] Gracefully killing a blocked thread
The “reason for the blocking” is inside the same process - or inside the kernel.
If it is inside the same process - then kill the process and restart it (together with the address space data). At least the new process will be guaranteed to be operable.
If it is inside the kernel - then sorry, but you need to reboot.
I can hardly imagine the multi-threaded architecture which will be able to recover from the situation when one of its threads was killed by TerminateThread.
That is why the unhandled exception kills the whole process and not the thread.
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com
----- Original Message -----
From: Moreira, Alberto
To: Windows System Software Devs Interest List
Sent: Thursday, January 29, 2004 7:18 PM
Subject: RE: [ntdev] Gracefully killing a blocked thread
So, if the reason for the blocking has crashed and we know that the thread is never going to be unblocked, should it stay there forever like a zombie ?
Alberto.
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com]On Behalf Of Maxim S. Shatskih
Sent: Thursday, January 29, 2004 11:09 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Gracefully killing a blocked thread
No. The thread is blocked for a reason, and, if the reason did not occur, then it must stay waiting.
Note that TerminateThread is a bad API (it causes the user stack of the thread to go leak), practically never useful. Why ever terminating a thread inside the alive process which continue to run?
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com
----- Original Message -----
From: Deepu.L.R
To: Windows System Software Devs Interest List
Sent: Thursday, January 29, 2004 1:47 PM
Subject: [ntdev] Gracefully killing a blocked thread
hi all,
Is there any way to gracefully terminate (other than using TerminateThread) a blocked thread in Nt/2000/2003?
regards
Deepu.L.R
Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@compuware.com
To unsubscribe send a blank email to xxxxx@lists.osr.com
Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@storagecraft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com
The contents of this e-mail are intended for the named addressee only. It contains information that may be confidential. Unless you are the named addressee or an authorized designee, you may not copy or use it, or disclose it to anyone else. If you received it in error please notify us immediately and then destroy it.
Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@earthlink.net
To unsubscribe send a blank email to xxxxx@lists.osr.com