multiproccess: What is the Dameon flag?
allen.fowler at yahoo.com
Wed Sep 16 06:34:07 CEST 2009
> > What is the Daemon flag and when/why would I want to use it?
> From the documentation: "When a process exits, it attempts to terminate
> all of its daemonic child processes.".
> Sometimes you want the main process to wait for its worker processes to
> terminate before terminating itself so that you can be sure that
> everything (including resources they might use) has been tidied up.
> Other times there's nothing to tidy up so you just want the worker
> processes to terminate when the main process terminates. In the second
> case the worker process are known as daemon processes.
Two clarification questions:
1) So, without that flag the parent process could finish before the kids, and the kids would keep running?
2) If you use kid.join() in parent, the parent will always wait for kid to finish before continuing? (And eventually quitting)
More information about the Python-list