dbTalk Databases Forums  

About BDB Concurrent Data Store applications

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


Discuss About BDB Concurrent Data Store applications in the comp.databases.berkeley-db forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
sunnyboy (Offline)
Junior Member
 
Posts: 4
Join Date: Jul 2006

Default About BDB Concurrent Data Store applications - 07-13-2006 , 08:26 PM






As we know that Berkeley DB provides interfaces supporting deadlock-free, multiple-reader/single writer access to the database.

Now I want to new five threads which want to do the 'write' operation with one database at the same time , but only one thread can write the db at one time, the other four will be hanged. This is the question that which is the next executable thread in the other four threads, what is the order and rule?

Thank you very much!

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

Default Re: About BDB Concurrent Data Store applications - 07-13-2006 , 10:06 PM






Quote:
Now I want to new five threads which want to do the 'write' operation
with one database at the same time , but only one thread can write the
db at one time, the other four will be hanged. This is the question
that which is the next executable thread in the other four threads,
what is the order and rule?
Berkeley DB will unlock the threads in the order they arrived. That,
of course, depends on how the threads are scheduled on your system.

Michael.



Reply With Quote
  #3  
Old   
sunnyboy (Offline)
Junior Member
 
Posts: 4
Join Date: Jul 2006

Post 07-14-2006 , 12:22 AM



Michael, Thank you very much!

And do you have any manuals about this part, I want to study more detailed.

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

Default Re: About BDB Concurrent Data Store applications - 07-14-2006 , 02:31 AM



Quote:
And do you have any manuals about this part, I want to study more
detailed.
This is really an implementation detail that isn't covered in our
documentation.

However, if you have a Berkeley DB source tree, look at
__lock_get_internal in lock/lock.c. You will see that there are
holding and waiting queues, and requests are put onto one of those
queues depending on whether the locks conflict.

I think the best reference book to read for this area is still Jim
Gray's "Transaction Processing: Concepts and Techniques".

Regards,
Michael.



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 - 2010, Jelsoft Enterprises Ltd.