[pybsddb] Private data in DBEnv (was: Re: bdb replica node problem)

Jesus Cea jcea at argo.es
Thu May 29 11:57:28 CEST 2008


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

Please, do not reuse threads/subject lines...

Yingbo Qiu wrote:
| BTW: I think pybsddb's DBEnv object should supply a method to assign
| some private item value.
|
| I have to use global variable to pass it into event_callback function.
|
| for example: db-4.7.25/examples_c/ex_rep/mgr/rep_mgr.c
|
| static void
| event_callback(dbenv, which, info)
|     DB_ENV *dbenv;
|     u_int32_t which;
|     void *info;
| {
|     APP_DATA *app = dbenv->app_private;
|     SHARED_DATA *shared = &app->shared_data;
|
|     info = NULL;                /* Currently unused. */
|
|     switch (which) {
|     case DB_EVENT_REP_CLIENT:
|         shared->is_master = 0;
|         break;
|
|     case DB_EVENT_REP_MASTER:
|         shared->is_master = 1;
|         break;
| ....
|
| With pybsddb, programmer just set "shared" to a global variable. :(

Good point. I will try to add support for this in 4.7.1.

Is there any other case, aside DBEnv?.

- --
Jesus Cea Avion                         _/_/      _/_/_/        _/_/_/
jcea at jcea.es - http://www.jcea.es/     _/_/    _/_/  _/_/    _/_/  _/_/
jabber / xmpp:jcea at 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.8 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iQCVAwUBSD5+A5lgi5GaxT1NAQKcVgP+JtVNMusmsRJGbj89s+6LD39a/t+a5EwA
DgpocuBkYYbtygx1wyhtfkxISmbRjTkkr09j2s7foaP2dqquxmf+E0crpghpC3in
AWqO0Gfo+HubTGHTJ3wdW711SvTdgG8cAlNEUYMO0VOyUCoGCtGSmb0/SY/Pgyns
/DbRdFq2jhc=
=YjBR
-----END PGP SIGNATURE-----



More information about the pybsddb mailing list