Differences in Process#destroy() between Windows and Unix implementations
Andreas Kohn
andreas.kohn at fredhopper.com
Tue Nov 9 19:31:24 UTC 2010
Hi,
there seems to be a difference in behavior between Process#destroy()
implementations on Windows and !Windows: on Windows TerminateProcess()
[1] is called, which gives the process no way to react or in any way
intercept the termination, while on Unix a simple SIGTERM is send which
the process can just decide to ignore. [2]
Is this intentional?
I do prefer the Windows behavior, mainly because I do create processes
once in a while that simply fail to terminate due to bugs in their
implementation, and having Process#destroy() as a last, and terminal,
resort is very helpful to work-around those issues.
Regards,
--
Andreas
[1]
http://hg.openjdk.java.net/jdk7/jdk7/jdk/file/d87c1c06bbf9/src/windows/native/java/lang/ProcessImpl_md.c
[2]
http://hg.openjdk.java.net/jdk7/jdk7/jdk/file/d87c1c06bbf9/src/solaris/native/java/lang/UNIXProcess_md.c
--
Never attribute to malice that which can be adequately explained by
stupidity. -- Hanlon's Razor
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://mail.openjdk.java.net/pipermail/core-libs-dev/attachments/20101109/8eb42638/signature.asc>
More information about the core-libs-dev
mailing list