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.