[IronPython] importing on different threads

Seo Sanghyeon sanxiyn at gmail.com
Thu Aug 21 14:59:58 CEST 2008


2008/8/21 Curt Hagenlocher <curt at hagenlocher.org>:
> Where IronPython is "worse" than CPython in this regard is that it takes us
> longer to import a module.  This increases the chance for a collision in an
> application where modules may be imported from multiple threads.

No, IronPython is "worse" in that its importer is not locked. CPython has
(in addition to Global Interpreter Lock, since imported module can be
a C extension)
a lock around its importer: see imp.acquire_lock and imp.release_lock. Since
import can cause another import, this is a reentrant lock.

-- 
Seo Sanghyeon



More information about the Ironpython-users mailing list