-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Christian Zagrodnick wrote:
> Hi there,
> 
> the DB.open method makes me wonder how it works
> (http://svn.zope.org/ZODB/trunk/src/ZODB/DB.py?rev=69551&view=auto)
> 
> It locks with self._a() and calls self._connectionMap which locks too. I
> cannot imagine a way this could possibly work.
> 
> I guess the lock should be released before the _connectionMap call?
> 
> Interestingly both all the tests pass and ZODB works...

Note the following in the __init__()::

        # Allocate lock.
        x = threading.RLock()
        self._a = x.acquire
        self._r = x.release

The lock is a "reentrant" lock[1], which means that subsequent locks
from within the same thread do not deadlock;  instead, they increment
the lock count.

[1] http://docs.python.org/lib/module-threading.html#l2h-3418


Tres.
- --
===================================================================
Tres Seaver          +1 202-558-7113          [EMAIL PROTECTED]
Palladion Software   "Excellence by Design"    http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFKm1r+gerLs4ltQ4RAkmjAKCQFc0CwZeWRmffajADcHqBpsY9qQCguZ12
1dFN7jpri+CtgfiGR86zH7w=
=uhXI
-----END PGP SIGNATURE-----

_______________________________________________
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zodb-dev

Reply via email to