race/deadlock when creating a multiprocessing.manager instance while importing a module ?
Sebastien Binet
seb.binet at gmail.com
Tue Dec 15 05:57:19 EST 2009
Dave,
[..snip..]
On Tuesday 15 December 2009 02:49:00 Dave Angel wrote:
> Since I don't see any other responses, I'll give my guess, even though
> I'm not very experienced with the multiprocessing module.
>
> It's my understanding that threads may not be created or destroyed
> during an import. So you need to find a way to defer the creation till
> the imports are done.
yes, I figured this much and I already wrapped my module with a ModuleFacade
object which has lazy properties attributes [1].
this solves the problem of import my module, but if the module importing my
module is itself being imported, I am back to square one.
and my module is being used by many people.
I guess I'd need at least a way to detect that somebody is trying to use the
lazy properties of my module facade while an import is "still active".
is there such a mechanism ?
cheers,
sebastien.
[1]
https://svnweb.cern.ch/trac/atlasoff/browser/Tools/PyUtils/trunk/python/AthFile/__init__.py
--
#########################################
# Dr. Sebastien Binet
# Laboratoire de l'Accelerateur Lineaire
# Universite Paris-Sud XI
# Batiment 200
# 91898 Orsay
#########################################
More information about the Python-list
mailing list