multiproccess: What is the Dameon flag?

Allen Fowler allen.fowler at yahoo.com
Wed Sep 16 00:34:07 EDT 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.

Thank you.

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)

Thank you,
:)



      



More information about the Python-list mailing list