On Sat, 2003-01-25 at 16:06, Randy Heiland wrote:
> Thanks for the reply and I apologize for my continuing ignorance.  Here is my
> current situation... I've written a servlet, call it MYServlet, which is a
> subclass of XMLRPCServlet.  In that servlet, I have a method that does a Python
> 'exec' and adds a variable to the Python globals().  From a Java client, I
> connect to MYServlet and execute some cmd, say, foo=1.  From another client, I
> connect to MYServlet and execute foo=2.  When I check the value of foo from the
> first client, the value of foo is 2.  What I want is to be able to connect to
> the same MYServlet (same URL addr) from different clients and have independent
> Python interpreters running.  I thought this would entail a factory servlet
> somehow.

Well, if you want a different interpreter the factory won't help you. 
You'll have to spawn another interpreter, and somehow keep track of
those and use interprocess communications to handle the communication. 
Difficult.

OTOH, you don't have to use globals() -- you can keep a separate
dictionary for each client if you don't want them to share state like
that.  It's fairly easy with exec, though I don't remember the specific
syntax.

> I'm lacking some basic understanding about Webware/WebKit.
> 
> I should also mention that I'm running the 'AppServer' which seems to fire off
> nine threads of 'python Launch.py ThreadedAppServer'

Yes, and those threads all share the same globals.  You won't get the
protection you want from threads, and Webware uses threads for the
concurrent running of servlets.  

-- 
Ian Bicking           Colorstudy Web Development
[EMAIL PROTECTED]   http://www.colorstudy.com
PGP: gpg --keyserver pgp.mit.edu --recv-keys 0x9B9E28B7
4869 N Talman Ave, Chicago, IL 60625 / (773) 275-7241



-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to