On Wed, 2003-03-05 at 17:50, Jason Hildebrand wrote:
> On Wed, 2003-03-05 at 16:53, Geoffrey Talvola wrote:
> > Jason Hildebrand [mailto:jason@...] 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.
Ok, I just committed this to CVS.
FYI, the recent Python 2.3a2 release has the exposed acquire_lock and
Python 2.3a2+ (#2, Feb 21 2003, 20:30:06)
[GCC 3.2.3 20030210 (Debian prerelease)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import imp
['C_BUILTIN', 'C_EXTENSION', 'IMP_HOOK', 'PKG_DIRECTORY',
'PY_CODERESOURCE', 'PY_COMPILED', 'PY_FROZEN', 'PY_RESOURCE',
'PY_SOURCE', 'SEARCH_ERROR', '__doc__',
'__name__', 'acquire_lock', 'find_module', 'get_frozen_object',
'get_magic', 'get_suffixes', 'init_builtin', 'init_frozen',
'is_builtin', 'is_frozen', 'load_compiled', 'load_dynamic',
'load_module', 'load_package', 'load_source', 'lock_held', 'new_module',
Jason D. Hildebrand