Sundial is somewhat correct. On all OSes, there are voluntary closes, and forced closes. On unix there are different signals and different kill -* numbers. On Windows there is WM_CLOSE message, or SetConsoleCtrlHandler (which under the hood is a csrss.exe getting a WM_CLOSE or a control C message), these 2 are voluntary. Then there is TerminateProcess which is forced.
TerminateProcess I know is privilage checked (not sure about how windows messages work). Also on NT Kernel, if a process did certain syscalls, (my specific experience is with NtCreateFile/CreateFile), a driver can freeze a thread, and absolutely nothing can terminate that process since NT Kernel runs a kernel mode APC (think unix signal) in each thread to terminate each thread and the process/PID disappears when the last thread is removed from the process, but the thread is stuck in a blocking synchronous IO call in a driver, the kernel can not preempt most kernel mode code (google IRQL) executing in a thread to schedule an APC. Basically, CreateFile is synchronous, the path driver UNC/My Network Places driver which implements "\\22.214.171.124\someshare" paths on NT is crap. This driver is called MUP, which is one of many MS schemes at user mode drivers. MUP connects to Workstation/COmputer Browser services, which does the actual socket IO from user mode. Why? Either MS decided kernel socket interface in the kernel is so difficult to use, or MS's My Network Places/Samba/CIFS implementation still uses DOS/16 bit code that was ported to 32 bits, but still has to be run in user mode. NT 6/Vista introduced a a couple new calls to cancel sync I/O in any thread from any thread, so perhaps this unterminatable process problems doesn't exist anymore in NT 6. When Explorer freezes for many seconds or file open freezes for many seconds when browsing network shares, blame CreateFile and MUP.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||