I just subscribed to the Perl5 Porters list. I might actually have some source code to contribute to the next release of Perl!
The whole issue came up when I realized, much to my dismay, that Ruby did not support kill on Win32. Because I need it for a project I'm working on, I decided to write my own. For that I started by scouring the various Win32 programming newsgroups and looking at the Perl source.
I quickly realized that all Perl does is call TerminateProcess(), which is analogous to a "kill -9" in Unix. It'll work, but it's not nice. I downloaded bleadperl and noticed that someone did add this bit of code:
So, at some point this week I'm going to submit my own approach to using kill on Win32 systems. And by "my own", I mean one I shamelessly plagiarized off the web, but which seems to work pretty well based on both experimentation and what I've read off of msdn.com.
And kill() only implementing "kill -9
Re:fork emulation
djberg96 on 2003-05-11T13:05:16
Ah, ok. I didn't realize that it was for the fork emulation.I still have what I believe is a slightly better approach, which is to use CreateRemoteThread + ExitProcess. It's still not as nice as PostThreadMessage, but it's nicer than TerminateProcess. The only drawback is that it won't work on Win9x machines. IMHO the Win9x platform is dead and we shouldn't worry about such things.