C
Chang LI
Does python support threads safely along with Apache 2.0 in web applications.
Chang
Chang
Chang,
I guess it depends whether you're using Python in a CGI or within
mod_python. Could you give us a little more information, or check the
mod_python documentation?
applications.
This is true, but it doesn't tell the whoel story: mod_python has takenDamjan said:Are you talking about mod_python?
If so, then yes. But note that Apache threads entering the python
interpreter (via mod_python) will be serialized on the GIL.
Damjan said:Are you talking about mod_python?
If so, then yes. But note that Apache threads entering the python
interpreter (via mod_python) will be serialized on the GIL.
Does python support threads safely along with Apache 2.0 in web applications.
Yes, use mod_python. I plan to use Python to replace PHP and other
languages. The low efficient CGI will be replaced by embedded Python
program. Apache 2.0 is faviority becuase the threads are must have
features.
Steve Holden said:This is true, but it doesn't tell the whoel story: mod_python has taken
care to make it possible to configure multiple interpreters - on a
per-directory basis if necessary. Obviously they all share the pure
code, but if I undestand correctly each has its own data space, and
hence its own GIL.
Graham said:There is actually a possible bug in PythonInterpPerDirectory directive
which applies even if threading isn't being used. Specifically, mod_python
doesn't calculate the interpreter name correctly and although access to a
directory by name and something in it should logically resolve to the
same interpreter name it doesn't. More information can be found at:
http://www.modpython.org/pipermail/mod_python/2004-November/016788.html
Overall, I am not sure that PythonInterpPerDirectory is a good idea, but
then it probably was created to workaround the short comings of the
module importing system in mod_python which makes it impossible in
mod_python.publisher to have an index.py file in separate directories
within the context of the one interpreter. It wouldn't take much effort to
fix this limitation in the module importing system, but there doesn't seem
to be much interest in doing so.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.