[Twisted-Python] Strange twistd behaviour

Jean-Paul Calderone exarkun at divmod.com
Mon Mar 12 08:56:04 MDT 2007


On Mon, 12 Mar 2007 15:41:04 +0100, Jarek Zgoda <jarek.zgoda at sensisoft.com> wrote:
>I have an application ran as a twistd plugin. It spawns a "worker thread" 
>that gets objects from Queue.Queue and runs in a "while 1: " loop. The 
>problem I got is that when I run the application without daemonizing it 
>(using -n switch for twistd) everything works fine, but as soon as it is run 
>as daemon, the thread does not perform the "looping". I am bit stuck, as I 
>don't know even where to look for possible causes... Can anybody put some 
>light here?
>

If you are starting the thread before the process daemonizes, you might want
to try starting it after daemonization instead and see if that helps.

You can do this by starting the thread in the startService method of a Service.

Combining forking and threading usually leads to suffering.

Jean-Paul




More information about the Twisted-Python mailing list