Details of "import lock" in 3.3

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 With importlib and other recent changes, what are the current details of "import lock"?. That is, the lock/locks held when Python code does "import", specially in the case of multithreading. Is that documented anywhere? Thanks! - -- Jesús Cea Avión _/_/ _/_/_/ _/_/_/ jcea@jcea.es - http://www.jcea.es/ _/_/ _/_/ _/_/ _/_/ _/_/ Twitter: @jcea _/_/ _/_/ _/_/_/_/_/ jabber / xmpp:jcea@jabber.org _/_/ _/_/ _/_/ _/_/ _/_/ "Things are not so easy" _/_/ _/_/ _/_/ _/_/ _/_/ _/_/ "My name is Dump, Core Dump" _/_/_/ _/_/_/ _/_/ _/_/ "El amor es poner tu felicidad en la felicidad de otro" - Leibniz -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQCVAwUBUinv7Jlgi5GaxT1NAQLX7QP/SBNuy869xSKRVNlWmAiDLpZOR9IHm77K fy+AG/aJDpk4BMcm+KNoHZyUtJJs2kndfz+OVTeU/mmlr+aXu/wA1yNB1HAjAwWO 4ZWyaN9WLrhv8xXomUlT8iqikc/9pEspgQbJAljUvMLVouixIdxga3IqtaT3FQZh wkV9v04G4OA= =P3PI -----END PGP SIGNATURE-----

Le Fri, 06 Sep 2013 17:08:28 +0200, Jesus Cea <jcea@jcea.es> a écrit :
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
With importlib and other recent changes, what are the current details of "import lock"?. That is, the lock/locks held when Python code does "import", specially in the case of multithreading. Is that documented anywhere?
Quick summary here: http://docs.python.org/3/whatsnew/3.3.html#a-finer-grained-import-lock Otherwise, I'm afraid the source code has the most information, e.g.: http://hg.python.org/cpython/file/1d88d04aade2/Lib/importlib/_bootstrap.py#l... Regards Antoine.

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 06/09/13 17:43, Antoine Pitrou wrote:
Quick summary here: http://docs.python.org/3/whatsnew/3.3.html#a-finer-grained-import-lock
Otherwise, I'm afraid the source code has the most information, e.g.: http://hg.python.org/cpython/file/1d88d04aade2/Lib/importlib/_bootstrap.py#l...
Yes,
I was depending of the global import lock in my code. I am evaluating impact under Python 3.3. Under Python 3.3, metafinder/loader MUST BE reentrant?. Can they count on the fact that they could be called concurrently by multiple threads but NOT for importing the SAME module?. - -- Jesús Cea Avión _/_/ _/_/_/ _/_/_/ jcea@jcea.es - http://www.jcea.es/ _/_/ _/_/ _/_/ _/_/ _/_/ Twitter: @jcea _/_/ _/_/ _/_/_/_/_/ jabber / xmpp:jcea@jabber.org _/_/ _/_/ _/_/ _/_/ _/_/ "Things are not so easy" _/_/ _/_/ _/_/ _/_/ _/_/ _/_/ "My name is Dump, Core Dump" _/_/_/ _/_/_/ _/_/ _/_/ "El amor es poner tu felicidad en la felicidad de otro" - Leibniz -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQCVAwUBUin8mJlgi5GaxT1NAQKQugP+N0VI/BhqKvcaUicu7YMR09VhFweoAE6h c48ltOrhlWhrauYc9XYeoEPZ2ksl9/SDnMt83cE+qLunSBltkSbYv3j/0LXWyHwk ZGjzh5vQGTgCu3/2iCkFWq/tSAsgUfk8YfbwPQK82L1gs7LbC5vt2jWlRwNQs0nl 2Sr1Nlbf7og= =GL0o -----END PGP SIGNATURE-----

On Fri, 06 Sep 2013 18:02:32 +0200 Jesus Cea <jcea@jcea.es> wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 06/09/13 17:43, Antoine Pitrou wrote:
Quick summary here: http://docs.python.org/3/whatsnew/3.3.html#a-finer-grained-import-lock
Otherwise, I'm afraid the source code has the most information, e.g.: http://hg.python.org/cpython/file/1d88d04aade2/Lib/importlib/_bootstrap.py#l...
Yes,
I was depending of the global import lock in my code. I am evaluating impact under Python 3.3.
Under Python 3.3, metafinder/loader MUST BE reentrant?.
No, they shouldn't have to. Normally, the global import lock is still held at this point. However, it is best to check the code if you want to be sure. Regards Antoine.
participants (2)
-
Antoine Pitrou
-
Jesus Cea