| 1 | <?xml version="1.0" encoding="UTF-8" standalone="no"?> |
| 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| 3 | <html xmlns="http://www.w3.org/1999/xhtml"> |
| 4 | <head> |
| 5 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
| 6 | <title>Programmer notes FAQ</title> |
| 7 | <link rel="stylesheet" href="gettingStarted.css" type="text/css" /> |
| 8 | <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /> |
| 9 | <link rel="start" href="index.html" title="Berkeley DB Programmer's Reference Guide" /> |
| 10 | <link rel="up" href="program.html" title="Chapter 15. Programmer Notes" /> |
| 11 | <link rel="prev" href="program_perfmon.html" title="Performance Event Monitoring" /> |
| 12 | <link rel="next" href="lock.html" title="Chapter 16. The Locking Subsystem" /> |
| 13 | </head> |
| 14 | <body> |
| 15 | <div xmlns="" class="navheader"> |
| 16 | <div class="libver"> |
| 17 | <p>Library Version 11.2.5.3</p> |
| 18 | </div> |
| 19 | <table width="100%" summary="Navigation header"> |
| 20 | <tr> |
| 21 | <th colspan="3" align="center">Programmer notes FAQ</th> |
| 22 | </tr> |
| 23 | <tr> |
| 24 | <td width="20%" align="left"><a accesskey="p" href="program_perfmon.html">Prev</a> </td> |
| 25 | <th width="60%" align="center">Chapter 15. |
| 26 | Programmer Notes |
| 27 | </th> |
| 28 | <td width="20%" align="right"> <a accesskey="n" href="lock.html">Next</a></td> |
| 29 | </tr> |
| 30 | </table> |
| 31 | <hr /> |
| 32 | </div> |
| 33 | <div class="sect1" lang="en" xml:lang="en"> |
| 34 | <div class="titlepage"> |
| 35 | <div> |
| 36 | <div> |
| 37 | <h2 class="title" style="clear: both"><a id="program_faq"></a>Programmer notes FAQ</h2> |
| 38 | </div> |
| 39 | </div> |
| 40 | </div> |
| 41 | <div class="orderedlist"> |
| 42 | <ol type="1"> |
| 43 | <li> |
| 44 | <span class="bold"> |
| 45 | <strong>What priorities should threads/tasks executing Berkeley DB functions |
| 46 | be given?</strong> |
| 47 | </span> |
| 48 | <p>Tasks executing Berkeley DB functions should have the same, or roughly |
| 49 | equivalent, system priorities. For example, it can be dangerous to give |
| 50 | tasks of control performing checkpoints a lower priority than tasks of |
| 51 | control doing database lookups, and starvation can sometimes result.</p> |
| 52 | </li> |
| 53 | <li> |
| 54 | <span class="bold"> |
| 55 | <strong>Why isn't the C++ API exception safe?</strong> |
| 56 | </span> |
| 57 | <p>The Berkeley DB C++ API is a thin wrapper around the C API that maps most |
| 58 | return values to exceptions, and gives the C++ handles the same |
| 59 | lifecycles as their C counterparts. One consequence is that if an |
| 60 | exception occurs while a cursor or transaction handle is open, the |
| 61 | application must explicitly close the cursor or abort the transaction.</p> |
| 62 | <p>Applications can be simplified and bugs avoided by creating wrapper |
| 63 | classes around <a href="../api_reference/C/dbc.html" class="olink">DBC</a> and <a href="../api_reference/C/txn.html" class="olink">TXN</a> that call the appropriate |
| 64 | cleanup method in the wrapper's destructor. By creating an instance |
| 65 | of the wrappers on the stack, C++ scoping rules will ensure that the |
| 66 | destructor is called before exception handling unrolls the block that |
| 67 | contains the wrapper object.</p> |
| 68 | </li> |
| 69 | <li> |
| 70 | <span class="bold"> |
| 71 | <strong> |
| 72 | How do I handle a "pass 4" error when trying to run one of the |
| 73 | example Performance Event Monitoring scripts on my Linux system? |
| 74 | The library configured with --enable-dtrace and built without error. |
| 75 | </strong> |
| 76 | </span> |
| 77 | <p> |
| 78 | A Linux installation can have SystemTap support for kernel probe points |
| 79 | without including the kernel "utrace" module needed to use userspace |
| 80 | probes. Pass 4 errors can occur when this required userspace |
| 81 | support is not present. |
| 82 | </p> |
| 83 | </li> |
| 84 | </ol> |
| 85 | </div> |
| 86 | </div> |
| 87 | <div class="navfooter"> |
| 88 | <hr /> |
| 89 | <table width="100%" summary="Navigation footer"> |
| 90 | <tr> |
| 91 | <td width="40%" align="left"><a accesskey="p" href="program_perfmon.html">Prev</a> </td> |
| 92 | <td width="20%" align="center"> |
| 93 | <a accesskey="u" href="program.html">Up</a> |
| 94 | </td> |
| 95 | <td width="40%" align="right"> <a accesskey="n" href="lock.html">Next</a></td> |
| 96 | </tr> |
| 97 | <tr> |
| 98 | <td width="40%" align="left" valign="top">Performance Event Monitoring </td> |
| 99 | <td width="20%" align="center"> |
| 100 | <a accesskey="h" href="index.html">Home</a> |
| 101 | </td> |
| 102 | <td width="40%" align="right" valign="top"> Chapter 16. |
| 103 | The Locking Subsystem |
| 104 | </td> |
| 105 | </tr> |
| 106 | </table> |
| 107 | </div> |
| 108 | </body> |
| 109 | </html> |