<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Oct 3, 2009, at 3:21 PM, Benjamin Rutt wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><p>The docs say (for the version shipped with python 2.6), in <a href="http://www.jcea.es/programacion/pybsddb_doc/4.7.3/introduction.html#introduction">http://www.jcea.es/programacion/pybsddb_doc/4.7.3/introduction.html#introduction</a>:<br>
<br>"3. Concurrent access dictionaries: This refers to the ability to simultaneously have one writer and multiple readers of a DB (either in multiple threads or processes) and is implemented simply by creating a DBEnv with certain flags. No extra work is required to allow this access mode in bsddb3."<br>
<br>Could someone elaborate on exactly which "certain flags" are needed when creating the DBEnv to achieve the goal here in #3? Did I get it right below (for the b-tree access method)?</p></blockquote><div><br></div>Sure.</div><div><br></div><div>This is the "INIT_CDB" model, been used by RPM for years.</div><div><br></div><div>Disclaimer: I don't use pybsddb nor python, but I do use Berkeley DB</div><div>with INIT_CDB daily for years.</div><div><blockquote type="cite"><p>from bsddb import db<br><br>env = db.DBEnv()<br>env.open('/some/dir', db.DB_CREATE | db.DB_THREAD | db.DB_INIT_CDB | db.DB_INIT_MPOOL)<br>dbh = db.DB(env)<br>dbh.open("foo.db", None, db.DB_BTREE, db.DB_CREATE)<br>
<br clear="all"></p></blockquote><div><br></div>These flags look right to me. Try w/o DB_THREAD if you need a sanity check,</div><div>that's exactly what RPM uses. DB_THREAD is needed iff you have threads</div><div>sharing the same locks as processes.</div><div><br></div><div>73 de Jeff</div></body></html>