Debian Codegraph @

docs/api_reference/C/envset_lk_partitions.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;set_lk_partitions()</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="lock.html" title="Chapter 6.  The DB_LOCK Handle" />
11 <link rel="prev" href="envset_lk_max_objects.html" title="DB_ENV-&gt;set_lk_max_objects()" />
12 <link rel="next" href="envset_lk_priority.html" title="DB_ENV-&gt;set_lk_priority()" />
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;set_lk_partitions()</th>
22 </tr>
23 <tr>
24 <td width="20%" align="left"><a accesskey="p" href="envset_lk_max_objects.html">Prev</a> </td>
25 <th width="60%" align="center">Chapter 6. 
26 The DB_LOCK Handle
27 </th>
28 <td width="20%" align="right"> <a accesskey="n" href="envset_lk_priority.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="envset_lk_partitions"></a>DB_ENV-&gt;set_lk_partitions()</h2>
38 </div>
39 </div>
40 </div>
41 <pre class="programlisting">#include &lt;db.h&gt;
42
43 int
44 DB_ENV-&gt;set_lk_partitions(DB_ENV *dbenv, u_int32_t partitions); </pre>
45 <p>
46 Set the number of lock table partitions in the Berkeley DB
47 environment. The default value is 10 times the number of CPUs on the
48 system if there is more than one CPU. Increasing the number of
49 partitions can provide for greater throughput on a system with
50 multiple CPUs and more than one thread contending for the lock
51 manager. On single processor systems more than one partition may
52 increase the overhead of the lock manager. Systems often report
53 threading contexts as CPUs. If your system does this, set the number of
54 partitions to 1 to get optimal performance.
55 </p>
56 <p>
57 The database environment's number of partitions may also be configured
58 using the environment's <a href="../../programmer_reference/env_db_config.html#env_db_config.DB_CONFIG" class="olink">DB_CONFIG</a> file. The
59 syntax of the entry in that file is a single line with the string
60 "set_lk_partitions", one or more whitespace characters, and the number
61 of partitions. Because the <a href="../../programmer_reference/env_db_config.html#env_db_config.DB_CONFIG" class="olink">DB_CONFIG</a> file is
62 read when the database environment is opened, it will silently
63 overrule configuration done before that time.
64 </p>
65 <p>
66 The <code class="methodname">DB_ENV-&gt;set_lk_partitions()</code> method configures a database
67 environment, not only operations performed using the specified
68 <a class="link" href="env.html" title="Chapter 5.  The DB_ENV Handle">DB_ENV</a> handle.
69 </p>
70 <p>
71 The <code class="methodname">DB_ENV-&gt;set_lk_partitions()</code> method may not be called after the
72 <a class="xref" href="envopen.html" title="DB_ENV-&gt;open()">DB_ENV-&gt;open()</a> method is
73 called. If the database environment already exists when
74 <a class="xref" href="envopen.html" title="DB_ENV-&gt;open()">DB_ENV-&gt;open()</a> is called, the
75 information specified to <code class="methodname">DB_ENV-&gt;set_lk_partitions()</code> will be ignored.
76 </p>
77 <p>
78 The <code class="methodname">DB_ENV-&gt;set_lk_partitions()</code> <span>
79 <span>
80 method returns a non-zero error value on failure and 0 on success.
81 </span>
82
83 </span>
84 </p>
85 <div class="sect2" lang="en" xml:lang="en">
86 <div class="titlepage">
87 <div>
88 <div>
89 <h3 class="title"><a id="idp52543544"></a>Parameters</h3>
90 </div>
91 </div>
92 </div>
93 <div class="sect3" lang="en" xml:lang="en">
94 <div class="titlepage">
95 <div>
96 <div>
97 <h4 class="title"><a id="idp52546112"></a>partitions</h4>
98 </div>
99 </div>
100 </div>
101 <p>
102 The <span class="bold"><strong>partitions</strong></span> parameter is the
103 number of partitions to be configured in the Berkeley DB environment.
104 </p>
105 </div>
106 </div>
107 <div class="sect2" lang="en" xml:lang="en">
108 <div class="titlepage">
109 <div>
110 <div>
111 <h3 class="title"><a id="idp52551600"></a>Errors</h3>
112 </div>
113 </div>
114 </div>
115 <p>
116 The <code class="methodname">DB_ENV-&gt;set_lk_partitions()</code> <span>
117 <span>
118 method may fail and return one of the following non-zero errors:
119 </span>
120
121 </span>
122 </p>
123 <div class="sect3" lang="en" xml:lang="en">
124 <div class="titlepage">
125 <div>
126 <div>
127 <h4 class="title"><a id="idp52568248"></a>EINVAL</h4>
128 </div>
129 </div>
130 </div>
131 <p>
132 If the method was called after <a class="xref" href="envopen.html" title="DB_ENV-&gt;open()">DB_ENV-&gt;open()</a>
133 was called; or if an invalid flag value or parameter was specified.
134 </p>
135 </div>
136 </div>
137 <div class="sect2" lang="en" xml:lang="en">
138 <div class="titlepage">
139 <div>
140 <div>
141 <h3 class="title"><a id="idp52567168"></a>Class</h3>
142 </div>
143 </div>
144 </div>
145 <p>
146 <a class="link" href="env.html" title="Chapter 5.  The DB_ENV Handle">DB_ENV</a>,
147 <a class="link" href="lock.html" title="Chapter 6.  The DB_LOCK Handle">DB_LOCK</a>
148 </p>
149 </div>
150 <div class="sect2" lang="en" xml:lang="en">
151 <div class="titlepage">
152 <div>
153 <div>
154 <h3 class="title"><a id="idp52570376"></a>See Also</h3>
155 </div>
156 </div>
157 </div>
158 <p>
159 <a class="xref" href="lock.html#locklist" title="Locking Subsystem and Related Methods">Locking Subsystem and Related Methods</a>
160 </p>
161 </div>
162 </div>
163 <div class="navfooter">
164 <hr />
165 <table width="100%" summary="Navigation footer">
166 <tr>
167 <td width="40%" align="left"><a accesskey="p" href="envset_lk_max_objects.html">Prev</a> </td>
168 <td width="20%" align="center">
169 <a accesskey="u" href="lock.html">Up</a>
170 </td>
171 <td width="40%" align="right"> <a accesskey="n" href="envset_lk_priority.html">Next</a></td>
172 </tr>
173 <tr>
174 <td width="40%" align="left" valign="top">DB_ENV-&gt;set_lk_max_objects() </td>
175 <td width="20%" align="center">
176 <a accesskey="h" href="index.html">Home</a>
177 </td>
178 <td width="40%" align="right" valign="top"> DB_ENV-&gt;set_lk_priority()</td>
179 </tr>
180 </table>
181 </div>
182 </body>
183 </html>