| Author |
Message |
sunnyboy *nix forums beginner
Joined: 14 Jul 2006
Posts: 2
|
Posted: Fri Jul 14, 2006 12:26 am Post subject:
About BDB Concurrent Data Store applications
|
|
|
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!
--
sunnyboy
------------------------------------------------------------------------
sunnyboy's Profile: http://www.dbtalk.net/m518
View this thread: http://www.dbtalk.net/t319174 |
|
| Back to top |
|
 |
Michael Cahill *nix forums Guru Wannabe
Joined: 26 May 2005
Posts: 219
|
Posted: Fri Jul 14, 2006 2:06 am Post subject:
Re: About BDB Concurrent Data Store applications
|
|
|
| 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. |
|
| Back to top |
|
 |
sunnyboy *nix forums beginner
Joined: 14 Jul 2006
Posts: 2
|
Posted: Fri Jul 14, 2006 4:22 am Post subject:
Re: About BDB Concurrent Data Store applications
|
|
|
Michael, Thank you very much!
And do you have any manuals about this part, I want to study more
detailed.:)
--
sunnyboy
------------------------------------------------------------------------
sunnyboy's Profile: http://www.dbtalk.net/m518
View this thread: http://www.dbtalk.net/t319174 |
|
| Back to top |
|
 |
Michael Cahill *nix forums Guru Wannabe
Joined: 26 May 2005
Posts: 219
|
Posted: Fri Jul 14, 2006 6:31 am Post subject:
Re: About BDB Concurrent Data Store applications
|
|
|
| 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. |
|
| Back to top |
|
 |
Google
|
|
| Back to top |
|
 |
|