Debian Codegraph @

docs/api_reference/CXX/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>DbEnv::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 10.  Mutex Methods" />
11 <link rel="prev" href="mutexset_init.html" title="DbEnv::mutex_set_init()" />
12 <link rel="next" href="mutexset_tas_spins.html" title="DbEnv::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">DbEnv::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 10. 
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>DbEnv::mutex_set_max()</h2>
38 </div>
39 </div>
40 </div>
41 <pre class="programlisting">#include &lt;db_cxx.h&gt;
42
43 int
44 DbEnv::mutex_set_max(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="DbEnv::set_mp_pagesize()">DbEnv::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">DbEnv::mutex_set_max()</code> method discards any value
62 previously set using the
63 <a class="xref" href="mutexset_increment.html" title="DbEnv::mutex_set_increment()">DbEnv::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">DbEnv::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 DbEnv Handle">DbEnv</a> handle.
77 </p>
78 <p>
79 The <code class="methodname">DbEnv::mutex_set_max()</code> method may not be called after the
80 <a class="xref" href="envopen.html" title="DbEnv::open()">DbEnv::open()</a> method is called.
81 If the database environment already exists when
82 <a class="xref" href="envopen.html" title="DbEnv::open()">DbEnv::open()</a> is called, the
83 information specified to <code class="methodname">DbEnv::mutex_set_max()</code> will be ignored.
84 </p>
85 <p>
86 The <code class="methodname">DbEnv::mutex_set_max()</code> <span>
87
88 <span>
89 method either returns a non-zero error value or throws an
90 exception that encapsulates a non-zero error value on
91 failure, and returns 0 on success.
92 </span>
93 </span>
94 </p>
95 <div class="sect2" lang="en" xml:lang="en">
96 <div class="titlepage">
97 <div>
98 <div>
99 <h3 class="title"><a id="idp9242024"></a>Parameters</h3>
100 </div>
101 </div>
102 </div>
103 <div class="sect3" lang="en" xml:lang="en">
104 <div class="titlepage">
105 <div>
106 <div>
107 <h4 class="title"><a id="idp9241376"></a>max</h4>
108 </div>
109 </div>
110 </div>
111 <p>
112 The <span class="bold"><strong>max</strong></span> parameter is the absolute
113 number of mutexes to allocate.
114 </p>
115 </div>
116 </div>
117 <div class="sect2" lang="en" xml:lang="en">
118 <div class="titlepage">
119 <div>
120 <div>
121 <h3 class="title"><a id="idp9233408"></a>Errors</h3>
122 </div>
123 </div>
124 </div>
125 <p>
126 The <code class="methodname">DbEnv::mutex_set_max()</code> <span>
127
128 <span>
129 method may fail and throw a <a class="link" href="dbexception.html" title="Chapter 6. The DbException Class">DbException</a>
130 exception, encapsulating one of the following non-zero errors, or return one
131 of the following non-zero errors:
132 </span>
133 </span>
134 </p>
135 <div class="sect3" lang="en" xml:lang="en">
136 <div class="titlepage">
137 <div>
138 <div>
139 <h4 class="title"><a id="idp9252448"></a>EINVAL</h4>
140 </div>
141 </div>
142 </div>
143 <p>
144 An invalid flag value or parameter was specified.
145 </p>
146 </div>
147 </div>
148 <div class="sect2" lang="en" xml:lang="en">
149 <div class="titlepage">
150 <div>
151 <div>
152 <h3 class="title"><a id="idp9251152"></a>Class</h3>
153 </div>
154 </div>
155 </div>
156 <p>
157 <a class="link" href="env.html" title="Chapter 5.  The DbEnv Handle">DbEnv</a>
158 </p>
159 </div>
160 <div class="sect2" lang="en" xml:lang="en">
161 <div class="titlepage">
162 <div>
163 <div>
164 <h3 class="title"><a id="idp9246400"></a>See Also</h3>
165 </div>
166 </div>
167 </div>
168 <p>
169 <a class="xref" href="mutex.html#mutexlist" title="Mutex Methods">Mutex Methods</a>
170 </p>
171 </div>
172 </div>
173 <div class="navfooter">
174 <hr />
175 <table width="100%" summary="Navigation footer">
176 <tr>
177 <td width="40%" align="left"><a accesskey="p" href="mutexset_init.html">Prev</a> </td>
178 <td width="20%" align="center">
179 <a accesskey="u" href="mutex.html">Up</a>
180 </td>
181 <td width="40%" align="right"> <a accesskey="n" href="mutexset_tas_spins.html">Next</a></td>
182 </tr>
183 <tr>
184 <td width="40%" align="left" valign="top">DbEnv::mutex_set_init() </td>
185 <td width="20%" align="center">
186 <a accesskey="h" href="index.html">Home</a>
187 </td>
188 <td width="40%" align="right" valign="top"> DbEnv::mutex_set_tas_spins()</td>
189 </tr>
190 </table>
191 </div>
192 </body>
193 </html>