472,110 Members | 1,852 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,110 software developers and data experts.

Berkely DB – many writers, many readers



I need to now option I open the Berkley DB (both db and env) to have
configuration for multiple writers and multiple readers. Via multiple
processes and multiple threads. No trx needed.

A.
Jul 21 '05 #1
2 1681
Andy Leszczynski wrote:

I need to now option I open the Berkley DB (both db and env) to have
configuration for multiple writers and multiple readers. Via multiple
processes and multiple threads. No trx needed.


the simple answer is you can't. bdbm is probably single writer multiple
reader. I believe if you use of the the most recent sleepy cat
database, you have support for multiple readers and writers in any context.

when I did this, I stuck my gdbm database into a multithreaded
stand-alone process. I used XML RPC for access and used a per key
locking mechanism internal to the data storage and retrieval process.
This locking mechanism set appropriate locks so that a writer for
specific key would wait for all readers of that key to finish, and block
all subsequent readers until it was done.

so far is working pretty well but I haven't tried it in a high load
situation.

---eric

Jul 21 '05 #2
Eric S. Johansson wrote:
Andy Leszczynski wrote:

I need to now option I open the Berkley DB (both db and env) to have
configuration for multiple writers and multiple readers. Via multiple
processes and multiple threads. No trx needed.

the simple answer is you can't. bdbm is probably single writer multiple
reader. I believe if you use of the the most recent sleepy cat
database, you have support for multiple readers and writers in any context.

[...]

I have learned later that you can, just use Concurrent DB poruct
(db.DB_INIT_CDB):

....envflags=db.DB_CREATE|db.DB_INIT_MPOOL|db.DB_T HREAD|db.DB_INIT_CDB
....env.open(file,envflags)

A.
Aug 7 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by M.Kumar | last post: by
2 posts views Thread by Lumpierbritches | last post: by
1 post views Thread by lakshmi | last post: by
3 posts views Thread by Trimtrom | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.