threading.thread.start() or thread.start_new_thread()?
Posted by JB Uy on November 28, 2013 at 03:13 PM UTC
Edited on December 13, 2013 at 08:41 PM UTC
Passing arguments into the function for start():
from threading import Thread my_thread = Thread(target=main_func, args=args, kwargs=kwargs) my_thread.start()
threads are by default non-daemonic.
So the parent will wait until all it's children are done before exiting.
By setting Daemon to True, the parent will exit regardless of it's children being done.