dbTalk Databases Forums  

I am lost the wish of BDB.

comp.databases.berkeley-db comp.databases.berkeley-db


Discuss I am lost the wish of BDB. in the comp.databases.berkeley-db forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
taoyonggang@hotmail.com
 
Posts: n/a

Default I am lost the wish of BDB. - 10-19-2005 , 08:26 PM






I plan use bdb to build a small message queue middleware,but it always
throw error when mult multithreading operate db and memory always
increase.

My data at all times insert ,read and delete in multithreading .

Can you give a full-blown and simple example?

thanks.

tao


Reply With Quote
  #2  
Old   
Michael Cahill
 
Posts: n/a

Default Re: I am lost the wish of BDB. - 10-20-2005 , 01:33 AM






Quote:
I plan use bdb to build a small message queue middleware,but it always
throw error when mult multithreading operate db and memory always
increase.

My data at all times insert ,read and delete in multithreading .

Can you give a full-blown and simple example?
You haven't said what language you're using, so I'll assume C++.
Please take a look at examples_cxx/TpcbExample.cpp in the Berkeley DB
source tree. It illustrates a transactional application with a single
thread.

You could run multiple copies simultaneously to see multi-process
access to data without any changes.

If you want to see multi-threading, you'll need to edit the code to add
DB_THREAD to the DbEnv:pen and Db:pen calls, then create multiple
threads to call app.run(...).

I hope this helps. If you are having a particular problem with some
code you have written, please post more details either here or to
support (AT) sleepycat (DOT) com and someone will try to help you out.

Regards,
Michael.



Reply With Quote
  #3  
Old   
taoyonggang@hotmail.com
 
Posts: n/a

Default Re: I am lost the wish of BDB. - 10-20-2005 , 08:51 PM



Thanks ,Regards,Michael.

I used vc++7.1 to build programe.
I used one dbenv and open 40 db by the dbenv.

envflag= DB_CREATE | DB_INIT_MPOOL | DB_INIT_LOG |DB_THREAD
dbflag = DB_CREATE|DB_DIRTY_READ|DB_THREAD

I create 40 threads to operate dbs and use my thread lock(not bdb) for
only one thread operating one db.
But ,after running period of time ,programe will throw error.
the error is b:ut: DB_RUNRECOVERY: Fatal error, run database
recovery


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.