Debian Codegraph @

docs/api_reference/C/mutexset_max.html

raw symbols SCIP
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_ENV-&gt;mutex_set_max()</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="mutex.html" title="Chapter 9.  Mutex Methods" />
11 <link rel="prev" href="mutexset_init.html" title="DB_ENV-&gt;mutex_set_init()" />
12 <link rel="next" href="mutexset_tas_spins.html" title="DB_ENV-&gt;mutex_set_tas_spins()" />
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">DB_ENV-&gt;mutex_set_max()</th>
22 </tr>
23 <tr>
24 <td width="20%" align="left"><a accesskey="p" href="mutexset_init.html">Prev</a> </td>
25 <th width="60%" align="center">Chapter 9. 
26 Mutex Methods
27 </th>
28 <td width="20%" align="right"> <a accesskey="n" href="mutexset_tas_spins.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="mutexset_max"></a>DB_ENV-&gt;mutex_set_max()</h2>
38 </div>
39 </div>
40 </div>
41 <pre class="programlisting">#include &lt;db.h&gt;
42
43 int
44 DB_ENV-&gt;mutex_set_max(DB_ENV *dbenv, u_int32_t max); </pre>
45 <p>
46 Configure the total number of mutexes to allocate. This method is
47 deprecated. The maximum size of the mutex region is now inferred by
48 the sizes of the other memory structures, and so this method is no
49 longer needed. For example, the cache requires one mutex per page
50 in the cache. When you specify the cache size, DB assumes a
51 page size of 4K and allocates mutexes accordingly. If your page
52 size is different than 4K, you indicate this using
53 <a class="xref" href="envset_mp_pagesize.html" title="DB_ENV-&gt;set_mp_pagesize()">DB_ENV-&gt;set_mp_pagesize()</a>.
54 DB will then allocate the proper number of mutexes based on this new page size.
55 </p>
56 <p>
57 You can use this method to override DB's mutex calculation, but
58 it is not recommended to do so.
59 </p>
60 <p>
61 Calling the <code class="methodname">DB_ENV-&gt;mutex_set_max()</code> method discards any value
62 previously set using the
63 <a class="xref" href="mutexset_increment.html" title="DB_ENV-&gt;mutex_set_increment()">DB_ENV-&gt;mutex_set_increment()</a> method.
64 </p>
65 <p>
66 The database environment's total number of mutexes may also be
67 configured using the environment's <a href="../../programmer_reference/env_db_config.html#env_db_config.DB_CONFIG" class="olink">DB_CONFIG</a> file. The syntax of
68 the entry in that file is a single line with the string
69 "mutex_set_max", one or more whitespace characters, and the total
70 number of mutexes. Because the <a href="../../programmer_reference/env_db_config.html#env_db_config.DB_CONFIG" class="olink">DB_CONFIG</a> file is read when the
71 database environment is opened, it will silently overrule
72 configuration done before that time.
73 </p>
74 <p>
75 The <code class="methodname">DB_ENV-&gt;mutex_set_max()</code> method configures a database environment,
76 not only operations performed using the specified <a class="link" href="env.html" title="Chapter 5.  The DB_ENV Handle">DB_ENV</a> handle.
77 </p>
78 <p>
79 The <code class="methodname">DB_ENV-&gt;mutex_set_max()</code> method may not be called after the
80 <a class="xref" href="envopen.html" title="DB_ENV-&gt;open()">DB_ENV-&gt;open()</a> method is called.
81 If the database environment already exists when
82 <a class="xref" href="envopen.html" title="DB_ENV-&gt;open()">DB_ENV-&gt;open()</a> is called, the
83 information specified to <code class="methodname">DB_ENV-&gt;mutex_set_max()</code> will be ignored.
84 </p>
85 <p>
86 The <code class="methodname">DB_ENV-&gt;mutex_set_max()</code> <span>
87 <span>
88 method returns a non-zero error value on failure and 0 on success.
89 </span>
90
91 </span>
92 </p>
93 <div class="sect2" lang="en" xml:lang="en">
94 <div class="titlepage">
95 <div>
96 <div>
97 <h3 class="title"><a id="idp53758488"></a>Parameters</h3>
98 </div>
99 </div>
100 </div>
101 <div class="sect3" lang="en" xml:lang="en">
102 <div class="titlepage">
103 <div>
104 <div>
105 <h4 class="title"><a id="idp53764120"></a>max</h4>
106 </div>
107 </div>
108 </div>
109 <p>
110 The <span class="bold"><strong>max</strong></span> parameter is the absolute
111 number of mutexes to allocate.
112 </p>
113 </div>
114 </div>
115 <div class="sect2" lang="en" xml:lang="en">
116 <div class="titlepage">
117 <div>
118 <div>
119 <h3 class="title"><a id="idp53768784"></a>Errors</h3>
120 </div>
121 </div>
122 </div>
123 <p>
124 The <code class="methodname">DB_ENV-&gt;mutex_set_max()</code> <span>
125 <span>
126 method may fail and return one of the following non-zero errors:
127 </span>
128
129 </span>
130 </p>
131 <div class="sect3" lang="en" xml:lang="en">
132 <div class="titlepage">
133 <div>
134 <div>
135 <h4 class="title"><a id="idp53784360"></a>EINVAL</h4>
136 </div>
137 </div>
138 </div>
139 <p>
140 An invalid flag value or parameter was specified.
141 </p>
142 </div>
143 </div>
144 <div class="sect2" lang="en" xml:lang="en">
145 <div class="titlepage">
146 <div>
147 <div>
148 <h3 class="title"><a id="idp53783280"></a>Class</h3>
149 </div>
150 </div>
151 </div>
152 <p>
153 <a class="link" href="env.html" title="Chapter 5.  The DB_ENV Handle">DB_ENV</a>
154 </p>
155 </div>
156 <div class="sect2" lang="en" xml:lang="en">
157 <div class="titlepage">
158 <div>
159 <div>
160 <h3 class="title"><a id="idp53782336"></a>See Also</h3>
161 </div>
162 </div>
163 </div>
164 <p>
165 <a class="xref" href="mutex.html#mutexlist" title="Mutex Methods">Mutex Methods</a>
166 </p>
167 </div>
168 </div>
169 <div class="navfooter">
170 <hr />
171 <table width="100%" summary="Navigation footer">
172 <tr>
173 <td width="40%" align="left"><a accesskey="p" href="mutexset_init.html">Prev</a> </td>
174 <td width="20%" align="center">
175 <a accesskey="u" href="mutex.html">Up</a>
176 </td>
177 <td width="40%" align="right"> <a accesskey="n" href="mutexset_tas_spins.html">Next</a></td>
178 </tr>
179 <tr>
180 <td width="40%" align="left" valign="top">DB_ENV-&gt;mutex_set_init() </td>
181 <td width="20%" align="center">
182 <a accesskey="h" href="index.html">Home</a>
183 </td>
184 <td width="40%" align="right" valign="top"> DB_ENV-&gt;mutex_set_tas_spins()</td>
185 </tr>
186 </table>
187 </div>
188 </body>
189 </html>