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>DbEnv::memp_trickle()</title> 7 <link rel="stylesheet" href="apiReference.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 C++ API Reference" /> 10 <link rel="up" href="memp.html" title="Chapter��9.�� The DbMpoolFile Handle" /> 11 <link rel="prev" href="mempsync.html" title="DbEnv::memp_sync()" /> 12 <link rel="next" href="envset_cache_max.html" title="DbEnv::set_cache_max()" /> 13 </head> 14 <body> 15 <div class="navheader"> 16 <table width="100%" summary="Navigation header"> 17 <tr> 18 <th colspan="3" align="center">DbEnv::memp_trickle()</th> 19 </tr> 20 <tr> 21 <td width="20%" align="left"><a accesskey="p" href="mempsync.html">Prev</a>��</td> 22 <th width="60%" align="center">Chapter��9.�� 23 The DbMpoolFile Handle 24 </th> 25 <td width="20%" align="right">��<a accesskey="n" href="envset_cache_max.html">Next</a></td> 26 </tr> 27 </table> 28 <hr /> 29 </div> 30 <div class="sect1" lang="en" xml:lang="en"> 31 <div class="titlepage"> 32 <div> 33 <div> 34 <h2 class="title" style="clear: both"><a id="memptrickle"></a>DbEnv::memp_trickle()</h2> 35 </div> 36 </div> 37 </div> 38 <pre class="programlisting">#include <db_cxx.h> 39 40int 41DbEnv::memp_trickle(int percent, int *nwrotep);</pre> 42 <p> 43 The <code class="methodname">DbEnv::memp_trickle()</code> method ensures that a specified percent of 44 the pages in the cache are clean, by writing dirty pages 45 to their backing files. 46 </p> 47 <p> 48 The purpose of the <code class="methodname">DbEnv::memp_trickle()</code> function is to enable a 49 memory pool manager to ensure that a page is always available for 50 reading in new information without having to wait for a write. 51 </p> 52 <p> 53 The <code class="methodname">DbEnv::memp_trickle()</code> <span> 54 55 <span> 56 method either returns a non-zero error value or throws an 57 exception that encapsulates a non-zero error value on 58 failure, and returns 0 on success. 59 </span> 60 </span> 61 </p> 62 <div class="sect2" lang="en" xml:lang="en"> 63 <div class="titlepage"> 64 <div> 65 <div> 66 <h3 class="title"><a id="id1692187"></a>Parameters</h3> 67 </div> 68 </div> 69 </div> 70 <div class="sect3" lang="en" xml:lang="en"> 71 <div class="titlepage"> 72 <div> 73 <div> 74 <h4 class="title"><a id="id1692044"></a>nwrotep</h4> 75 </div> 76 </div> 77 </div> 78 <p> 79 The <span class="bold"><strong>nwrotep</strong></span> parameter references 80 memory into which the number of pages written to reach the specified 81 percentage is copied. 82 </p> 83 </div> 84 <div class="sect3" lang="en" xml:lang="en"> 85 <div class="titlepage"> 86 <div> 87 <div> 88 <h4 class="title"><a id="id1692484"></a>percent</h4> 89 </div> 90 </div> 91 </div> 92 <p> 93 The <span class="bold"><strong>percent</strong></span> parameter is the percent 94 of the pages in the cache that should be clean. 95 </p> 96 </div> 97 </div> 98 <div class="sect2" lang="en" xml:lang="en"> 99 <div class="titlepage"> 100 <div> 101 <div> 102 <h3 class="title"><a id="id1692137"></a>Errors</h3> 103 </div> 104 </div> 105 </div> 106 <p> 107 The <code class="methodname">DbEnv::memp_trickle()</code> <span> 108 109 <span> 110 method may fail and throw a <a class="link" href="dbexception.html" title="Chapter��6.��The DbException Class">DbException</a> 111 exception, encapsulating one of the following non-zero errors, or return one 112 of the following non-zero errors: 113 </span> 114 </span> 115 following non-zero errors: 116 </p> 117 <div class="sect3" lang="en" xml:lang="en"> 118 <div class="titlepage"> 119 <div> 120 <div> 121 <h4 class="title"><a id="id1692282"></a>EINVAL</h4> 122 </div> 123 </div> 124 </div> 125 <p> 126 An invalid flag value or parameter was specified. 127 </p> 128 </div> 129 </div> 130 <div class="sect2" lang="en" xml:lang="en"> 131 <div class="titlepage"> 132 <div> 133 <div> 134 <h3 class="title"><a id="id1692361"></a>Class</h3> 135 </div> 136 </div> 137 </div> 138 <p> 139 <a class="link" href="env.html" title="Chapter��5.�� The DbEnv Handle">DbEnv</a>, <a class="link" href="memp.html" title="Chapter��9.�� The DbMpoolFile Handle">DbMpoolFile</a> 140 </p> 141 </div> 142 <div class="sect2" lang="en" xml:lang="en"> 143 <div class="titlepage"> 144 <div> 145 <div> 146 <h3 class="title"><a id="id1692523"></a>See Also</h3> 147 </div> 148 </div> 149 </div> 150 <p> 151 <a class="xref" href="memp.html#memplist" title="Memory Pools and Related Methods">Memory Pools and Related Methods</a> 152 </p> 153 </div> 154 </div> 155 <div class="navfooter"> 156 <hr /> 157 <table width="100%" summary="Navigation footer"> 158 <tr> 159 <td width="40%" align="left"><a accesskey="p" href="mempsync.html">Prev</a>��</td> 160 <td width="20%" align="center"> 161 <a accesskey="u" href="memp.html">Up</a> 162 </td> 163 <td width="40%" align="right">��<a accesskey="n" href="envset_cache_max.html">Next</a></td> 164 </tr> 165 <tr> 166 <td width="40%" align="left" valign="top">DbEnv::memp_sync()��</td> 167 <td width="20%" align="center"> 168 <a accesskey="h" href="index.html">Home</a> 169 </td> 170 <td width="40%" align="right" valign="top">��DbEnv::set_cache_max()</td> 171 </tr> 172 </table> 173 </div> 174 </body> 175</html> 176