× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Yes, kill() is the correct API.

Signal 12 (SIGKILL) is like ending a job with option(*immed), and does not provide the job with a chance to shut down properly.

Signal 6 (SIGTERM) is like ending a job with option(*cntrld). It lets the job catch the signal, do it's own shut down processing, and then end gracefully.

Normally, in a Unix environment (which is what the signal() APIs are trying to emulate) you'd send SIGTERM first, and if the job doesn't end within a given timeout period, you'd send SIGKILL to force it to end.

Also, when a spawned job ends, you'll be sent the SIGCHLD signal. Make sure you catch it and use waitpid() to clean up any resources for that child, otherwise the job's status will be kept for you to retrieve later... which wastes memory for each spawned job.


beppecosta@xxxxxxxxxxx wrote:
I would like to say that I already tried with kill() + signal 12 and actually the child process ends.

Is this the right way to end it ?

Thanks.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.