running a thread in the nginx worker process cycle
Manlio Perillo
manlio_perillo at libero.it
Thu Dec 27 18:33:22 MSK 2007
Igor Sysoev ha scritto:
> On Thu, Dec 27, 2007 at 03:39:10PM +0100, Manlio Perillo wrote:
>
>> With mod_wsgi I'm starting to testing threading usage in the Python
>> application.
>>
>> Do I have to take some precautions when starting a new thread?
>> In the nginx sources I see that some signals are blocked.
>>
>> Above all, it is safe to start a new thread?
>
> It's not simple question. I can not say right now.
>
>
Ok, thanks.
I will try to do some better tests, however the WSGI application at:
http://hg.mperillo.ath.cx/nginx/mod_wsgi/file/tip/examples/nginx-thread-pool.py
seems to work, even with an high level of concurrency.
By the way, there is an interesting post about a multithreaded python
application embedded in PostgreSQL (with plpython):
http://mail.python.org/pipermail/python-list/2007-December/468320.html
In that case, Tome Lane response is simply:
Don't even *think* about starting multiple threads inside the Postgres
backend. It's an excellent way to break things.
Manlio Perillo
More information about the nginx
mailing list