[ros-users] handling multiple topics in Python

Blaise Gassend blaise at willowgarage.com
Thu Apr 15 23:52:43 UTC 2010


That is not true. 

Daemon threads will exit when they feel like it, possibly never. The
whole point of them is that you can use them to write daemons. 

With daemon threads, your program will appear to have exited, but your
daemon threads will exit only when they decide to. It is possible that
in some cases, when your non-daemon threads exit, necessary components
of your application will be down causing the daemon threads to crash,
but that is not generally true.

On Thu, 2010-04-15 at 12:37 -0700, Brian Mayton wrote:
> On Apr 15, 2010, at 10:59 AM, Blaise Gassend wrote:
> 
> > Also, if you are using threads, SIGINT will only kill one of them even
> > without rospy. You have to make sure that each thread exits after a
> > KeyboardInterrupt (or after rospy.is_shutdown() goes true in the case of
> > rospy).
> 
> 
> You can also call .isDaemon(True) on the threads when you create them.  Threads that are marked as "daemon" threads will automatically exit when there are no non-daemon threads remaining (e.g. the main thread has exited after a SIGINT.)
> _______________________________________________
> ros-users mailing list
> ros-users at code.ros.org
> https://code.ros.org/mailman/listinfo/ros-users





More information about the ros-users mailing list