Debian Codegraph @

docs/api_reference/C/mutexset_align.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_align()</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="mutexlock.html" title="DB_ENV-&gt;mutex_lock()" />
12 <link rel="next" href="mutexset_increment.html" title="DB_ENV-&gt;mutex_set_increment()" />
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_align()</th>
22 </tr>
23 <tr>
24 <td width="20%" align="left"><a accesskey="p" href="mutexlock.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_increment.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_align"></a>DB_ENV-&gt;mutex_set_align()</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_align(DB_ENV *dbenv, u_int32_t align); </pre>
45 <p>
46 Set the mutex alignment, in bytes.
47 </p>
48 <p>
49 It is sometimes advantageous to align mutexes on specific byte
50 boundaries in order to minimize cache line collisions. The
51 <code class="methodname">DB_ENV-&gt;mutex_set_align()</code> method specifies an alignment for mutexes
52 allocated by Berkeley DB.
53 </p>
54 <p>
55 The database environment's mutex alignment may also be configured
56 using the environment's <a href="../../programmer_reference/env_db_config.html#env_db_config.DB_CONFIG" class="olink">DB_CONFIG</a> file. The
57 syntax of the entry in that file is a single line with the string
58 "mutex_set_align", one or more whitespace characters, and the mutex
59 alignment in bytes. Because the <a href="../../programmer_reference/env_db_config.html#env_db_config.DB_CONFIG" class="olink">DB_CONFIG</a> file is
60 read when the database environment is opened, it will silently
61 overrule configuration done before that time.
62 </p>
63 <p>
64 The <code class="methodname">DB_ENV-&gt;mutex_set_align()</code> method configures a database
65 environment, not only operations performed using the specified
66 <a class="link" href="env.html" title="Chapter 5.  The DB_ENV Handle">DB_ENV</a> handle.
67 </p>
68 <p>
69 The <code class="methodname">DB_ENV-&gt;mutex_set_align()</code> method may not be called after the
70 <a class="xref" href="envopen.html" title="DB_ENV-&gt;open()">DB_ENV-&gt;open()</a> method is
71 called. If the database environment already exists when
72 <a class="xref" href="envopen.html" title="DB_ENV-&gt;open()">DB_ENV-&gt;open()</a> is called, the
73 information specified to <code class="methodname">DB_ENV-&gt;mutex_set_align()</code> will be ignored.
74 </p>
75 <p>
76 The <code class="methodname">DB_ENV-&gt;mutex_set_align()</code> <span>
77 <span>
78 method returns a non-zero error value on failure and 0 on success.
79 </span>
80
81 </span>
82 </p>
83 <div class="sect2" lang="en" xml:lang="en">
84 <div class="titlepage">
85 <div>
86 <div>
87 <h3 class="title"><a id="idp53728560"></a>Parameters</h3>
88 </div>
89 </div>
90 </div>
91 <div class="sect3" lang="en" xml:lang="en">
92 <div class="titlepage">
93 <div>
94 <div>
95 <h4 class="title"><a id="idp53706152"></a>align</h4>
96 </div>
97 </div>
98 </div>
99 <p>
100 The <span class="bold"><strong>align</strong></span> parameter is the mutex
101 alignment, in bytes. The mutex alignment must be a power-of-two.
102 </p>
103 </div>
104 </div>
105 <div class="sect2" lang="en" xml:lang="en">
106 <div class="titlepage">
107 <div>
108 <div>
109 <h3 class="title"><a id="idp53710792"></a>Errors</h3>
110 </div>
111 </div>
112 </div>
113 <p>
114 The <code class="methodname">DB_ENV-&gt;mutex_set_align()</code> <span>
115 <span>
116 method may fail and return one of the following non-zero errors:
117 </span>
118
119 </span>
120 </p>
121 <div class="sect3" lang="en" xml:lang="en">
122 <div class="titlepage">
123 <div>
124 <div>
125 <h4 class="title"><a id="idp53744344"></a>EINVAL</h4>
126 </div>
127 </div>
128 </div>
129 <p>
130 If the method was called after <a class="xref" href="envopen.html" title="DB_ENV-&gt;open()">DB_ENV-&gt;open()</a>
131 was called; or if an invalid flag value or parameter was specified.
132 </p>
133 </div>
134 </div>
135 <div class="sect2" lang="en" xml:lang="en">
136 <div class="titlepage">
137 <div>
138 <div>
139 <h3 class="title"><a id="idp53743264"></a>Class</h3>
140 </div>
141 </div>
142 </div>
143 <p>
144 <a class="link" href="env.html" title="Chapter 5.  The DB_ENV Handle">DB_ENV</a>
145 </p>
146 </div>
147 <div class="sect2" lang="en" xml:lang="en">
148 <div class="titlepage">
149 <div>
150 <div>
151 <h3 class="title"><a id="idp53746512"></a>See Also</h3>
152 </div>
153 </div>
154 </div>
155 <p>
156 <a class="xref" href="mutex.html#mutexlist" title="Mutex Methods">Mutex Methods</a>
157 </p>
158 </div>
159 </div>
160 <div class="navfooter">
161 <hr />
162 <table width="100%" summary="Navigation footer">
163 <tr>
164 <td width="40%" align="left"><a accesskey="p" href="mutexlock.html">Prev</a> </td>
165 <td width="20%" align="center">
166 <a accesskey="u" href="mutex.html">Up</a>
167 </td>
168 <td width="40%" align="right"> <a accesskey="n" href="mutexset_increment.html">Next</a></td>
169 </tr>
170 <tr>
171 <td width="40%" align="left" valign="top">DB_ENV-&gt;mutex_lock() </td>
172 <td width="20%" align="center">
173 <a accesskey="h" href="index.html">Home</a>
174 </td>
175 <td width="40%" align="right" valign="top"> DB_ENV-&gt;mutex_set_increment()</td>
176 </tr>
177 </table>
178 </div>
179 </body>
180 </html>