diff options
| author | Lorry Tar Creator <lorry-tar-importer@baserock.org> | 2015-02-17 17:25:57 +0000 |
|---|---|---|
| committer | <> | 2015-03-17 16:26:24 +0000 |
| commit | 780b92ada9afcf1d58085a83a0b9e6bc982203d1 (patch) | |
| tree | 598f8b9fa431b228d29897e798de4ac0c1d3d970 /docs/programmer_reference/lock_nondb.html | |
| parent | 7a2660ba9cc2dc03a69ddfcfd95369395cc87444 (diff) | |
| download | berkeleydb-master.tar.gz | |
Diffstat (limited to 'docs/programmer_reference/lock_nondb.html')
| -rw-r--r-- | docs/programmer_reference/lock_nondb.html | 86 |
1 files changed, 48 insertions, 38 deletions
diff --git a/docs/programmer_reference/lock_nondb.html b/docs/programmer_reference/lock_nondb.html index 066666a4..7c242f70 100644 --- a/docs/programmer_reference/lock_nondb.html +++ b/docs/programmer_reference/lock_nondb.html @@ -14,17 +14,16 @@ <body> <div xmlns="" class="navheader"> <div class="libver"> - <p>Library Version 11.2.5.3</p> + <p>Library Version 12.1.6.1</p> </div> <table width="100%" summary="Navigation header"> <tr> - <th colspan="3" align="center">Locking and non-Berkeley DB applications</th> + <th colspan="3" align="center">Locking and non-Berkeley DB + applications</th> </tr> <tr> <td width="20%" align="left"><a accesskey="p" href="lock_am_conv.html">Prev</a> </td> - <th width="60%" align="center">Chapter 16. - The Locking Subsystem - </th> + <th width="60%" align="center">Chapter 16. The Locking Subsystem </th> <td width="20%" align="right"> <a accesskey="n" href="log.html">Next</a></td> </tr> </table> @@ -34,38 +33,50 @@ <div class="titlepage"> <div> <div> - <h2 class="title" style="clear: both"><a id="lock_nondb"></a>Locking and non-Berkeley DB applications</h2> + <h2 class="title" style="clear: both"><a id="lock_nondb"></a>Locking and non-Berkeley DB + applications</h2> </div> </div> </div> - <p>The Lock subsystem is useful outside the context of Berkeley DB. It can be -used to manage concurrent access to any collection of either ephemeral -or persistent objects. That is, the lock region can persist across -invocations of an application, so it can be used to provide long-term -locking (for example, conference room scheduling).</p> - <p>In order to use the locking subsystem in such a general way, the -applications must adhere to a convention for identifying objects and -lockers. Consider a conference room scheduling problem, in which there -are three conference rooms scheduled in half-hour intervals. The -scheduling application must then select a way to identify each -conference room/time slot combination. In this case, we could describe -the objects being locked as bytestrings consisting of the conference -room name, the date when it is needed, and the beginning of the -appropriate half-hour slot.</p> - <p>Lockers are 32-bit numbers, so we might choose to use the User ID of -the individual running the scheduling program. To schedule half-hour -slots, all the application needs to do is issue a <a href="../api_reference/C/lockget.html" class="olink">DB_ENV->lock_get()</a> call -for the appropriate locker/object pair. To schedule a longer slot, the -application needs to issue a <a href="../api_reference/C/lockvec.html" class="olink">DB_ENV->lock_vec()</a> call, with one -<a href="../api_reference/C/lockget.html" class="olink">DB_ENV->lock_get()</a> operation per half-hour — up to the total length. If -the <a href="../api_reference/C/lockvec.html" class="olink">DB_ENV->lock_vec()</a> call fails, the application would have to release -the parts of the time slot that were obtained.</p> - <p>To cancel a reservation, the application would make the appropriate -<a href="../api_reference/C/lockput.html" class="olink">DB_ENV->lock_put()</a> calls. To reschedule a reservation, the -<a href="../api_reference/C/lockget.html" class="olink">DB_ENV->lock_get()</a> and <a href="../api_reference/C/lockput.html" class="olink">DB_ENV->lock_put()</a> calls could all be made inside of -a single <a href="../api_reference/C/lockvec.html" class="olink">DB_ENV->lock_vec()</a> call. The output of <a href="../api_reference/C/lockstat.html" class="olink">DB_ENV->lock_stat()</a> could -be post-processed into a human-readable schedule of conference room -use.</p> + <p> + The Lock subsystem is useful outside the context of Berkeley + DB. It can be used to manage concurrent access to any + collection of either ephemeral or persistent objects. That is, + the lock region can persist across invocations of an + application, so it can be used to provide long-term locking + (for example, conference room scheduling). + </p> + <p> + In order to use the locking subsystem in such a general way, + the applications must adhere to a convention for identifying + objects and lockers. Consider a conference room scheduling + problem, in which there are three conference rooms scheduled + in half-hour intervals. The scheduling application must then + select a way to identify each conference room/time slot + combination. In this case, we could describe the objects being + locked as bytestrings consisting of the conference room name, + the date when it is needed, and the beginning of the + appropriate half-hour slot. + </p> + <p> + Lockers are 32-bit numbers, so we might choose to use the + User ID of the individual running the scheduling program. To + schedule half-hour slots, all the application needs to do is + issue a <a href="../api_reference/C/lockget.html" class="olink">DB_ENV->lock_get()</a> call for the appropriate locker/object pair. + To schedule a longer slot, the application needs to issue a + <a href="../api_reference/C/lockvec.html" class="olink">DB_ENV->lock_vec()</a> call, with one <a href="../api_reference/C/lockget.html" class="olink">DB_ENV->lock_get()</a> operation per half-hour + — up to the total length. If the <a href="../api_reference/C/lockvec.html" class="olink">DB_ENV->lock_vec()</a> call fails, + the application would have to release the parts of the time + slot that were obtained. + </p> + <p> + To cancel a reservation, the application would make the + appropriate <a href="../api_reference/C/lockput.html" class="olink">DB_ENV->lock_put()</a> calls. To reschedule a reservation, the + <a href="../api_reference/C/lockget.html" class="olink">DB_ENV->lock_get()</a> and <a href="../api_reference/C/lockput.html" class="olink">DB_ENV->lock_put()</a> calls could all be made inside of a + single <a href="../api_reference/C/lockvec.html" class="olink">DB_ENV->lock_vec()</a> call. The output of <a href="../api_reference/C/lockstat.html" class="olink">DB_ENV->lock_stat()</a> could be + post-processed into a human-readable schedule of conference + room use. + </p> </div> <div class="navfooter"> <hr /> @@ -78,13 +89,12 @@ use.</p> <td width="40%" align="right"> <a accesskey="n" href="log.html">Next</a></td> </tr> <tr> - <td width="40%" align="left" valign="top">Berkeley DB Transactional Data Store locking conventions </td> + <td width="40%" align="left" valign="top">Berkeley DB Transactional Data + Store locking conventions </td> <td width="20%" align="center"> <a accesskey="h" href="index.html">Home</a> </td> - <td width="40%" align="right" valign="top"> Chapter 17. - The Logging Subsystem - </td> + <td width="40%" align="right" valign="top"> Chapter 17. The Logging Subsystem </td> </tr> </table> </div> |
