Meaning of daemon property on Python Threads

Is this saying that this program won’t ever finish?

Yes, that program won’t finish, just try it out.

I ask because I have a situation where
in my main thread I’m calling
sys.exit(), and the process just hangs
and my other threads are running as I
can see the log. Does this have
anything to do with sys.exit() being
called with threads alive?

Yes, even exit won’t stop other threads, it simply raises SystemExit in the main thread. So while the main thread will stop (just like it does on any other unhandled Exception), all other non-daemonic threads will continue to work.

Leave a Comment