On Wed, 2003-03-05 at 16:53, Geoffrey Talvola wrote:
> Jason Hildebrand [mailto:[EMAIL PROTECTED] wrote:
> <snip>
> > Note: I need to tweak the Webware source to check for the lock and use
> > it if available.  We can do this already, so that the code will take
> > advantage of the lock when running on newer Python versions.
> 
> Would it also help for current versions of Python to use our own import lock
> around __import__ if the Python import lock isn't available?

Yes, this is a good idea to reduce the likelihood of concurrent
imports.  I'll work on a fix which will use the interpreter's global
lock (if available), and if not will use it's own lock.

> A workaround might be to pre-import your servlets using explicit import
> statements in your context's __init__.py.  I think the __init__.py gets
> imported before it fires up the thread pool, so there would be no risk of
> concurrent imports.

Another good idea.

> In my testing, I often have multiple simultaneous requests come in for the
> same servlet immediately after restarting the appserver, but I've never
> encountered a problem with simultaneous imports.  I suppose whether or not
> it's a problem depends on what the side effects of the imports are.

The side effects are pretty undefined.  It could be that people have
been bitten by this and just don't know it.

-- 
Jason D. Hildebrand
[EMAIL PROTECTED]



-------------------------------------------------------
This SF.net email is sponsored by: Etnus, makers of TotalView, The debugger 
for complex code. Debugging C/C++ programs can leave you feeling lost and 
disoriented. TotalView can help you find your way. Available on major UNIX 
and Linux platforms. Try it free. www.etnus.com
_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to