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>DB_MPOOLFILE->set_priority()</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 8. The DB_MPOOLFILE Handle" /> 11 <link rel="prev" href="mempset_pgcookie.html" title="DB_MPOOLFILE->set_pgcookie()" /> 12 <link rel="next" href="mutex.html" title="Chapter 9. Mutex Methods" /> 13 </head> 14 <body> 15 <div class="navheader"> 16 <table width="100%" summary="Navigation header"> 17 <tr> 18 <th colspan="3" align="center">DB_MPOOLFILE->set_priority()</th> 19 </tr> 20 <tr> 21 <td width="20%" align="left"><a accesskey="p" href="mempset_pgcookie.html">Prev</a> </td> 22 <th width="60%" align="center">Chapter 8. 23 The DB_MPOOLFILE Handle 24 </th> 25 <td width="20%" align="right"> <a accesskey="n" href="mutex.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="mempset_priority"></a>DB_MPOOLFILE->set_priority()</h2> 35 </div> 36 </div> 37 </div> 38 <pre class="programlisting">#include <db.h> 39 40int 41DB_MPOOLFILE->set_priority(DB_MPOOLFILE *mpf, DB_CACHE_PRIORITY priority); </pre> 42 <p> 43 Set the cache priority for pages referenced by the 44 <a class="link" href="memp.html" title="Chapter 8. The DB_MPOOLFILE Handle">DB_MPOOLFILE</a> handle. 45 </p> 46 <p> 47 The priority of a page biases the replacement algorithm to be more or 48 less likely to discard a page when space is needed in the cache. 49 The bias is temporary, and pages will eventually be discarded if they 50 are not referenced again. The <code class="methodname">DB_MPOOLFILE->set_priority()</code> method is 51 only advisory, and does not guarantee pages will be treated in a 52 specific way. 53 </p> 54 <p> 55 To set the priority for the pages belonging to a particular database, 56 call the <code class="methodname">DB_MPOOLFILE->set_priority()</code> method using the 57 <a class="link" href="memp.html" title="Chapter 8. The DB_MPOOLFILE Handle">DB_MPOOLFILE</a> handle 58 returned by the <a class="xref" href="dbget_mpf.html" title="DB->get_mpf()">DB->get_mpf()</a> method. 59 </p> 60 <p> 61 The <code class="methodname">DB_MPOOLFILE->set_priority()</code> method configures a file in the 62 cache, not only operations performed using the specified 63 <a class="link" href="memp.html" title="Chapter 8. The DB_MPOOLFILE Handle">DB_MPOOLFILE</a> handle. 64 </p> 65 <p> 66 The <code class="methodname">DB_MPOOLFILE->set_priority()</code> method may be called at any time 67 during the life of the application. 68 </p> 69 <p> 70 The <code class="methodname">DB_MPOOLFILE->set_priority()</code> <span> 71 <span> 72 method returns a non-zero error value on failure and 0 on success. 73 </span> 74 75 </span> 76 </p> 77 <div class="sect2" lang="en" xml:lang="en"> 78 <div class="titlepage"> 79 <div> 80 <div> 81 <h3 class="title"><a id="id1692700"></a>Parameters</h3> 82 </div> 83 </div> 84 </div> 85 <div class="sect3" lang="en" xml:lang="en"> 86 <div class="titlepage"> 87 <div> 88 <div> 89 <h4 class="title"><a id="id1692957"></a>priority</h4> 90 </div> 91 </div> 92 </div> 93 <p> 94 The <span class="bold"><strong>priority</strong></span> parameter must be set to 95 one of the following values: 96 </p> 97 <div class="itemizedlist"> 98 <ul type="disc"> 99 <li> 100 <p> 101 <code class="literal">DB_PRIORITY_VERY_LOW</code> 102 </p> 103 <p> 104 The lowest priority: pages are the most likely to be discarded. 105 </p> 106 </li> 107 <li> 108 <p> 109 <code class="literal">DB_PRIORITY_LOW</code> 110 </p> 111 <p> 112 The next lowest priority. 113 </p> 114 </li> 115 <li> 116 <p> 117 <code class="literal">DB_PRIORITY_DEFAULT</code> 118 </p> 119 <p> 120 The default priority. 121 </p> 122 </li> 123 <li> 124 <p> 125 <code class="literal">DB_PRIORITY_HIGH</code> 126 </p> 127 <p> 128 The next highest priority. 129 </p> 130 </li> 131 <li> 132 <p> 133 <code class="literal">DB_PRIORITY_VERY_HIGH</code> 134 </p> 135 <p> 136 The highest priority: pages are the least likely to be discarded. 137 </p> 138 </li> 139 </ul> 140 </div> 141 </div> 142 </div> 143 <div class="sect2" lang="en" xml:lang="en"> 144 <div class="titlepage"> 145 <div> 146 <div> 147 <h3 class="title"><a id="id1693250"></a>Class</h3> 148 </div> 149 </div> 150 </div> 151 <p> 152 <a class="link" href="env.html" title="Chapter 5. The DB_ENV Handle">DB_ENV</a>, <a class="link" href="memp.html" title="Chapter 8. The DB_MPOOLFILE Handle">DB_MPOOLFILE</a> 153 </p> 154 </div> 155 <div class="sect2" lang="en" xml:lang="en"> 156 <div class="titlepage"> 157 <div> 158 <div> 159 <h3 class="title"><a id="id1693271"></a>See Also</h3> 160 </div> 161 </div> 162 </div> 163 <p> 164 <a class="xref" href="memp.html#memplist" title="Memory Pools and Related Methods">Memory Pools and Related Methods</a> 165 </p> 166 </div> 167 </div> 168 <div class="navfooter"> 169 <hr /> 170 <table width="100%" summary="Navigation footer"> 171 <tr> 172 <td width="40%" align="left"><a accesskey="p" href="mempset_pgcookie.html">Prev</a> </td> 173 <td width="20%" align="center"> 174 <a accesskey="u" href="memp.html">Up</a> 175 </td> 176 <td width="40%" align="right"> <a accesskey="n" href="mutex.html">Next</a></td> 177 </tr> 178 <tr> 179 <td width="40%" align="left" valign="top">DB_MPOOLFILE->set_pgcookie() </td> 180 <td width="20%" align="center"> 181 <a accesskey="h" href="index.html">Home</a> 182 </td> 183 <td width="40%" align="right" valign="top"> Chapter 9. 184 Mutex Methods 185 </td> 186 </tr> 187 </table> 188 </div> 189 </body> 190</html> 191