diff options
author | Guido van Rossum <guido@python.org> | 1998-03-03 22:26:50 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1998-03-03 22:26:50 (GMT) |
commit | 75acc9ca1c2415717951ac11347714563894b325 (patch) | |
tree | fa149a3c9fa6a1b26cfa2f3382a4676122ab4475 /Lib/plat-aix4/IN.py | |
parent | 78535706517b3e6bf0c2e594e3c53dbed10c016e (diff) | |
download | cpython-75acc9ca1c2415717951ac11347714563894b325.zip cpython-75acc9ca1c2415717951ac11347714563894b325.tar.gz cpython-75acc9ca1c2415717951ac11347714563894b325.tar.bz2 |
Add a single Python-wide (!) lock on import. Only one thread at a
time can be in PyImport_ImportModuleEx(). Recursive calls from the
same thread are okay.
Potential problems:
- The lock should really be part of the interpreter state rather than
global, but that would require modifying more files, and I first want
to figure out whether this works at all.
- One could argue that the lock should be per module -- however that
would be complicated to implement. We would have to have a linked
list of locks per module name, *or* invent a new object type to
represent a lock, so we can store the locks in the module or in a
separate dictionary. Both seem unwarranted. The one situation where
this can cause problems is when loading a module takes a long time,
e.g. when the module's initialization code interacts with the user --
during that time, no other threads can run. I say, "too bad."
Diffstat (limited to 'Lib/plat-aix4/IN.py')
0 files changed, 0 insertions, 0 deletions