Debian Codegraph @

docs/api_reference/CXX/mutexstat.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_stat()</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_tas_spins.html" title="DbEnv::mutex_set_tas_spins()" />
12 <link rel="next" href="mutexstat_print.html" title="DbEnv::mutex_stat_print()" />
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_stat()</th>
22 </tr>
23 <tr>
24 <td width="20%" align="left"><a accesskey="p" href="mutexset_tas_spins.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="mutexstat_print.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="mutexstat"></a>DbEnv::mutex_stat()</h2>
38 </div>
39 </div>
40 </div>
41 <pre class="programlisting">#include &lt;db_cxx.h&gt;
42
43 int
44 DbEnv::mutex_stat(DB_MUTEX_STAT **statp, u_int32_t flags); </pre>
45 <p>
46 The <code class="methodname">DbEnv::mutex_stat()</code> method returns the mutex subsystem
47 statistics.
48 </p>
49 <p>
50 The <code class="methodname">DbEnv::mutex_stat()</code> method creates a statistical structure of
51 type <code class="literal">DB_MUTEX_STAT</code> and copies a pointer to it into a user-specified
52 memory location.
53 </p>
54 <p>
55 Statistical structures are stored in allocated memory. If
56 application-specific allocation routines have been declared (see
57 <a class="xref" href="envset_alloc.html" title="DbEnv::set_alloc()">DbEnv::set_alloc()</a>
58 for more information), they are used to allocate the memory;
59 otherwise, the standard C library <span class="bold"><strong>malloc</strong></span>(3) is used. The caller is responsible
60 for deallocating the memory. To deallocate the memory, free the
61 memory reference; references inside the returned memory need not be
62 individually freed.
63 </p>
64 <p>
65 The following <code class="literal">DB_MUTEX_STAT</code> fields will be filled in:
66 </p>
67 <div class="itemizedlist">
68 <ul type="disc">
69 <li>
70 <p>
71 <span class="bold"><strong>u_int32_t st_mutex_align;</strong></span>
72 </p>
73 <p>
74 The mutex alignment, in bytes.
75 </p>
76 </li>
77 <li>
78 <p>
79 <span class="bold"><strong>int st_mutex_cnt;</strong></span>
80 </p>
81 <p>
82 The total number of mutexes configured.
83 </p>
84 </li>
85 <li>
86 <p>
87 <span class="bold"><strong>u_int32_t st_mutex_free;</strong></span>
88 </p>
89 <p>
90 The number of mutexes currently available.
91 </p>
92 </li>
93 <li>
94 <p>
95 <span class="bold"><strong>u_int32_t st_mutex_init;</strong></span>
96 </p>
97 <p>
98 The initial number of mutexes configured.
99 </p>
100 </li>
101 <li>
102 <p>
103 <span class="bold"><strong>u_int32_t st_mutex_inuse;</strong></span>
104 </p>
105 <p>
106 The number of mutexes currently in use.
107 </p>
108 </li>
109 <li>
110 <p>
111 <span class="bold"><strong>u_int32_t st_mutex_inuse_max;</strong></span>
112 </p>
113 <p>
114 The maximum number of mutexes ever in use.
115 </p>
116 </li>
117 <li>
118 <p>
119 <span class="bold"><strong>u_int32_t st_mutex_max;</strong></span>
120 </p>
121 <p>
122 The maximum number of mutexes.
123 </p>
124 </li>
125 <li>
126 <p>
127 <span class="bold"><strong>u_int32_t st_mutex_tas_spins;</strong></span>
128 </p>
129 <p>
130 The number of times test-and-set mutexes will spin without blocking.
131 </p>
132 </li>
133 <li>
134 <p>
135 <span class="bold"><strong>uintmax_t st_region_wait;</strong></span>
136 </p>
137 <p>
138 The number of times that a thread of control was forced to wait before
139 obtaining the mutex region mutex.
140 </p>
141 </li>
142 <li>
143 <p>
144 <span class="bold"><strong>uintmax_t st_region_nowait;</strong></span>
145 </p>
146 <p>
147 The number of times that a thread of control was able to obtain the
148 mutex region mutex without waiting.
149 </p>
150 </li>
151 <li>
152 <p>
153 <span class="bold"><strong>roff_t st_regmax;</strong></span>
154 </p>
155 <p>
156 The max size of the mutex region size.
157 </p>
158 </li>
159 <li>
160 <p>
161 <span class="bold"><strong>roff_t st_regsize;</strong></span>
162 </p>
163 <p>
164 The size of the mutex region, in bytes.
165 </p>
166 </li>
167 </ul>
168 </div>
169 <p>
170 The <code class="methodname">DbEnv::mutex_stat()</code> method may not be called before the
171 <a class="xref" href="envopen.html" title="DbEnv::open()">DbEnv::open()</a> method is called.
172 </p>
173 <p>
174 The <code class="methodname">DbEnv::mutex_stat()</code> <span>
175
176 <span>
177 method either returns a non-zero error value or throws an
178 exception that encapsulates a non-zero error value on
179 failure, and returns 0 on success.
180 </span>
181 </span>
182 </p>
183 <div class="sect2" lang="en" xml:lang="en">
184 <div class="titlepage">
185 <div>
186 <div>
187 <h3 class="title"><a id="idp9279160"></a>Parameters</h3>
188 </div>
189 </div>
190 </div>
191 <div class="sect3" lang="en" xml:lang="en">
192 <div class="titlepage">
193 <div>
194 <div>
195 <h4 class="title"><a id="idp9269816"></a>statp</h4>
196 </div>
197 </div>
198 </div>
199 <p>
200 The <span class="bold"><strong>statp</strong></span> parameter references memory
201 into which a pointer to the allocated statistics structure is copied.
202 </p>
203 </div>
204 <div class="sect3" lang="en" xml:lang="en">
205 <div class="titlepage">
206 <div>
207 <div>
208 <h4 class="title"><a id="idp9282728"></a>flags</h4>
209 </div>
210 </div>
211 </div>
212 <p>
213 The <span class="bold"><strong>flags</strong></span> parameter must be set to 0
214 or the following value:
215 </p>
216 <div class="itemizedlist">
217 <ul type="disc">
218 <li>
219 <p>
220 <code class="literal">DB_STAT_CLEAR</code>
221 </p>
222 <p>
223 Reset statistics after returning their values.
224 </p>
225 </li>
226 </ul>
227 </div>
228 </div>
229 </div>
230 <div class="sect2" lang="en" xml:lang="en">
231 <div class="titlepage">
232 <div>
233 <div>
234 <h3 class="title"><a id="idp9287976"></a>Errors</h3>
235 </div>
236 </div>
237 </div>
238 <p>
239 The <code class="methodname">DbEnv::mutex_stat()</code> <span>
240
241 <span>
242 method may fail and throw a <a class="link" href="dbexception.html" title="Chapter 6. The DbException Class">DbException</a>
243 exception, encapsulating one of the following non-zero errors, or return one
244 of the following non-zero errors:
245 </span>
246 </span>
247 </p>
248 <div class="sect3" lang="en" xml:lang="en">
249 <div class="titlepage">
250 <div>
251 <div>
252 <h4 class="title"><a id="idp9281880"></a>EINVAL</h4>
253 </div>
254 </div>
255 </div>
256 <p>
257 An invalid flag value or parameter was specified.
258 </p>
259 </div>
260 </div>
261 <div class="sect2" lang="en" xml:lang="en">
262 <div class="titlepage">
263 <div>
264 <div>
265 <h3 class="title"><a id="idp9294720"></a>Class</h3>
266 </div>
267 </div>
268 </div>
269 <p>
270 <a class="link" href="env.html" title="Chapter 5.  The DbEnv Handle">DbEnv</a>
271 </p>
272 </div>
273 <div class="sect2" lang="en" xml:lang="en">
274 <div class="titlepage">
275 <div>
276 <div>
277 <h3 class="title"><a id="idp9291568"></a>See Also</h3>
278 </div>
279 </div>
280 </div>
281 <p>
282 <a class="xref" href="mutex.html#mutexlist" title="Mutex Methods">Mutex Methods</a>
283 </p>
284 </div>
285 </div>
286 <div class="navfooter">
287 <hr />
288 <table width="100%" summary="Navigation footer">
289 <tr>
290 <td width="40%" align="left"><a accesskey="p" href="mutexset_tas_spins.html">Prev</a> </td>
291 <td width="20%" align="center">
292 <a accesskey="u" href="mutex.html">Up</a>
293 </td>
294 <td width="40%" align="right"> <a accesskey="n" href="mutexstat_print.html">Next</a></td>
295 </tr>
296 <tr>
297 <td width="40%" align="left" valign="top">DbEnv::mutex_set_tas_spins() </td>
298 <td width="20%" align="center">
299 <a accesskey="h" href="index.html">Home</a>
300 </td>
301 <td width="40%" align="right" valign="top"> DbEnv::mutex_stat_print()</td>
302 </tr>
303 </table>
304 </div>
305 </body>
306 </html>