PDA

View Full Version : kill(pid,sig) in windows


kenna
05-16-2007, 06:16 AM
Hi,

is there an equivalent function in windows or is it possible to emulate the kill(pid,sig) function?

I don't know of any other simple way of interprocess communication, since pipes, sockets, etc. is simply too much of a bother, signals are much easier and quicker to use.

EDIT: and ofcourse I mean in C (^_^)

Kenneth Gorking
05-16-2007, 07:47 AM
This old sample (http://www.nwlink.com/~mikeblas/samples/mfctlist.zip) is in C++, but all the functions for finding the running processes and how to kill them will be easy to extract. Happy killing :)

kenna
05-16-2007, 07:52 AM
Thanks for the example, I'll be sure to go through it thoroughly to see if I can find anything useful.

However, the problem here is not terminating a process, but sending signals between processes, e.g. kill(pid, SIGINT), to allow for interrupt-like communication between processes. I haven't found any information for this on the internet, except that windows doesn't use signals as IPC, so you can only use raise.

Any suggestions as how to use signals, or a signal-like system for IPC in windows?

Jare
05-16-2007, 09:43 AM
http://www.codeproject.com/win32/Win32_Event_Handling.asp