What is the difference between
thread module is the low-level threading API of Python. Its direct usage isn't recommended, unless you really need to. The
threading module is a high-level API, built on top of
Thread.start method is actually implemented using
daemon attribute of
Thread must be set before calling
start, specifying whether the thread should be a daemon. The entire Python program exits when no alive non-daemon threads are left. By default,
False, so the thread is not a daemon, and hence the process will wait for all its non-daemon thread to exit, which is the behavior you're observing.
start_new_thread really is very low-level. It's just a thin wrapper around the Python core thread launcher, which itself calls the OS thread spawning function.