[Tutor] thread not running

Evert Rol evert.rol at gmail.com
Mon Dec 10 16:16:14 CET 2007


>> What's going wrong when running it with 2.4? AfaIcs, all modules are
>> in 2.4, so it my not have to do anything with the Python version, but
>> with the underlying system. Any traceback? Perhaps replace the
>> subprocess part with just a print statement to see what's happening?
>
> There are no tracebacks, and I have done some more investigation:
> 1. the thread code works fine standalone on both systems
> 2. the thread code works within CherryPy on my home PC but does not  
> work within CherryPy on the live host
> 3. Both run the same version of CherryPy - I could not imagine it  
> is a CherryPy issue, but unless you have any suggestion I'll try  
> the CherryPy list
>

I think the CherryPy mailing list will indeed now be your best option  
now.
Simple things I can think of (without any CherryPy experience) are  
eg: is the IO actually not flushed in some way (one would think  
running it in shell through subprocess would do that, though), so  
that you won't see any output while there is; or is there somehow a  
thread started from another (sub)thread, not the main thread. I don't  
know what the latter will do, but it may cause some unexpected results.
It's typical that it works for one CherryPy system, but not for another.
If you want to find out if it could be related to the Python version,  
you can download the Python 2.4.4 source code and do a 'make  
altinstall', which will leave the Python 2.5 version alone; you'll  
need to install the CherryPy & dependency modules as well then (which  
go in lib/python2.4/site-packages/).


> The live code runs under supervisor.  Could that make a difference?

I'm not familiar with the concept of 'supervisor' in this context,  
but a quick glance at wikipedia suggest that that could indeed be a  
problem: "A [...] supervisor is a computer program, usually part of  
an operating system, that controls the execution of other routines  
and regulates work scheduling, input/output operations, error  
actions, and similar functions and regulates the flow of work in a  
data processing system."
So it could control your threads (and output from them, or even  
prevent them from running.
Then again, as far as I've understood Python, threads within Python  
still run within the same system thread/PID, so it's still one  
program to the underlying OS (which a quick check seems to confirm).

Good luck,

   Evert



More information about the Tutor mailing list