[Python-Dev] 2.3.1 is (almost) a go

"Martin v. Löwis" martin at v.loewis.de
Sat Sep 27 16:39:32 EDT 2003


Skip Montanaro wrote:

> According to info I got from Sleepycat, a DBEnv is required for using in a
> multi-threaded environment.  Since the legacy bsddb module API is widely
> used and use of threading has increased in the past couple years, I think we
> need to figure out how to solve that problem.  This is just a wild-ass guess
> (I think I posted something like it before), but maybe all that's needed is
> to extend the bsddb.(bt|hash|rn)open functions to accept a dbenv arg, define
> a module-level default environment in bsddb/__init__.py which is used as the
> dbenv arg if the caller doesn't provide one.  The __init__.py code would
> look like this:
> 
>     _env = db.DBEnv()

I think we should define a set of flags for the "common case". In 
general, multiple threads may write to the same database, as might 
multiple instances of the application. IOW, we might want to create
the environment with DB_INIT_CDB|DB_INIT_MPOOL|DB_THREAD.

Applications that don't want to suffer from the possible
serialization of CDB would need to use their own environment.

Regards,
Martin





More information about the Python-Dev mailing list