Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6169473
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T22:51:49+00:00 2026-05-23T22:51:49+00:00

I have a Linux app which must spawn a child process on request with

  • 0

I have a Linux app which must spawn a child process on request with one of the exec() functions.

If the child process has not finished before it’s time to spawn it again, the app must kill the previous instance before starting the new one. It does this with

kill(pid, SIGTERM);

I’m keeping the pid of the previous instance and using

waitpid(pid, &status, WNOHANG)

to reap the process.

It seems that sometimes there’s an extremely long time window (possibly into the hundreds of milliseconds) between issuing the kill call and being able to reap the process with waitpid.

What could cause this? I thought that unless the child process set a signal hander (this one doesn’t) then it would be killed virtually immediately. This is on a 200MHz ARM9 but still … seems odd to me.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T22:51:51+00:00Added an answer on May 23, 2026 at 10:51 pm

    The process may catch SIGTERM in order to perform its own cleanup before shutting down.

    Even if it doesn’t, you don’t know how long it’ll take the OS to shut down the process.

    Trying to rely on things like this is a fool’s errand.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an app that executes commands on a Linux server via SSH just
I have configured my Django app to run under Apache+FastCGI on Linux (Ubuntu, if
I have an Open Source app and I have it working on Windows, Linux
I have got a multi-threaded app that process a very large data file. Works
Is there a way to have Linux read ahead when cloning a disk? I
I have 3 Linux machines, and want some way to keep the dotfiles in
I have a Linux web server farm with about 5 web servers, web traffic
We have a Linux server application that is comprised of a number of open-source
We have a Linux application that makes use of OpenSSL's Python bindings and I
I have a Linux server with multiple ips (so, multiple eth0, eth0:0, eth0:1 etc).

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.