Helping ordinary people create extraordinary websites!

Port Windows IPC Apps to Linux, Part 1: Processes and Threads

By Srinivasan S. Muthuswamy, Kavitha Varadarajan
2005-06-16

Terminating a process
To forcibly terminate a running process, you can use TerminateProcess() in Windows.


BOOL TerminateProcess(
HANDLE hProcess, // handle to the process
UINT uExitCode // exit code for the process
);

This function terminates the running process and all the associated threads. Use this function only in extreme scenarios.

In Linux, you can use kill() to forcibly kill a process: int kill(pid_t pid, int sig). This system call terminates the process of id PID. You can also use it to signal to any group or process.





Tutorial pages:

First published by IBM DeveloperWorks


 3 Votes

You might also want to check these out:


Leave a Comment on "Port Windows IPC Apps to Linux, Part 1: Processes and Threads"
You must be logged in to post a comment.

Link to This Tutorial Page!


GET OUR NEWSLETTERS