0

I have a "master" process that needs to spawn some child processes.

How can I manage these child processes? (for example, restart if the process is dead)

Thanks!

asked Oct 3, 2010 at 17:07

3 Answers 3

4

Have a look at celery.

answered Oct 3, 2010 at 17:10
Sign up to request clarification or add additional context in comments.

2 Comments

You are a god among men. Thanks for saving me a weekend.
@Jordan, that is the best comment ever posted to Stack Overflow.
3

If you use the multiprocessing package, every child process has is_alive method you can check. So one option to to hold a list of all running processes and periodically check is_alive and re-spawn dead processes.

If you're on POSIX system, you can also catch SIGCHLD (using signal) and get notified when a child process dies.

answered Oct 3, 2010 at 17:13

Comments

1
answered Oct 3, 2010 at 17:13

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.