[New-bugs-announce] [issue1567] Patch for new API method _PyImport_ImportModuleNoLock(char *name)

Christian Heimes report at bugs.python.org
Fri Dec 7 14:24:04 CET 2007


New submission from Christian Heimes:

The patch adds a new API method _PyImport_ImportModuleNoLock(const char
*name). It works mostly like PyImport_ImportModule except it does not
block. It tries to fetch the module from sys.modules first and falls
back to PyImport_ImportModule UNLESS the import lock is held by another
thread.

It fixes several issues related to dead locks when a thread uses a
function that imports a module but another thread holds the lock. It
doesn't require static caching of modules.

The patch is against py3k but I can backport it to 2.6.

----------
files: import_nolock.diff
messages: 58272
nosy: gvanrossum, tiran
priority: normal
severity: normal
status: open
title: Patch for new API method _PyImport_ImportModuleNoLock(char *name)
versions: Python 2.6, Python 3.0
Added file: http://bugs.python.org/file8888/import_nolock.diff

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue1567>
__________________________________
-------------- next part --------------
A non-text attachment was scrubbed...
Name: import_nolock.diff
Type: text/x-diff
Size: 13547 bytes
Desc: not available
Url : http://mail.python.org/pipermail/new-bugs-announce/attachments/20071207/6df69264/attachment.diff 


More information about the New-bugs-announce mailing list