[Python-Dev] PyWX (Python AOLserver plugin)

Neil Schemenauer nascheme@enme.ucalgary.ca
Tue, 12 Sep 2000 12:03:55 -0600


You probably want to address the python-dev mailing list.  I have CCed
this message in the hope that some of the more experienced developers
can help.  The PyWX website is at: http://pywx.idyll.org/.

On Tue, Sep 12, 2000 at 10:40:36AM -0700, Brent Fulgham wrote:
> We've run across some problems with the Python's internal threading
> design, and its handling of module loading.
> 
> The AOLserver plugin spawns new Python interpreter threads to
> service new HTTP connections.  Each thread is theoretically its
> own interpreter, and should have its own namespace, set of loaded
> packages, etc.
> 
> This is largely true, but we run across trouble with the way
> the individual threads handle 'argv' variables and current
> working directory.
> 
> CGI scripts typically pass data as variables to the script
> (as argv).  These (unfortunately) are changed globally across
> all Python interpreter threads, which can cause problems....
> 
> In addition, the current working directory is not unique
> among independent Python interpreters.  So if a script changes
> its directory to something, all other running scripts (in
> unique python interpreter threads) now have their cwd set to
> this directory.
> 
> So we have to address these issues at some point...  Any hope
> that something like this could be fixed in 2.0?

Are you using separate interpreters or one interpreter with multiple
threads?  It sounds like the latter.  If you use the latter than
definately things like the process address space and the current working
directory are shared across the threads.  I don't think I understand
your design.  Can you explain the architecture of PyWX?

  Neil