[bind10-dev] exit from multiple threads python process
Shane Kerr
shane at isc.org
Mon Oct 18 11:57:19 UTC 2010
Likun,
On Mon, 2010-10-18 at 18:37 +0800, Likun Zhang wrote:
> 1. main thread exit first, let python interpreter handle the left
> threads. (vorner suggested)
>
> 2. Main thread wait until all other threads exit by join each
> thread. (This the current way xfrout/xfrin used)
>
>
>
> The reason mentioned by vorner for the first way is:
>
>
>
> one, it looks scary
Can't argue with that! :)
> two, if there is a daemon thread (the kind interpretter doesn't wait
> for) and it does not terminate by itself, we wait indefinitely. But
> that's not what someone starting a daemon thread would expect.
For this to be a problem, the main thread would 1) have to know about
the new thread, and 2) not know that it is a daemon. This is a potential
problem, but something easily avoided in our software.
For me, the main argument in favor of explicitly checking is that you
can give the user some indication that the program is done.
This may not seem like much, but as an administrator BIND 9 has been
very frustrating in use because you don't know when it has started or
not, so I can imagine actually knowing when a process is done could be
quite nice. :)
--
Shane
More information about the bind10-dev
mailing list