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">
5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6 <title>DB_ENV->set_mp_max_write()</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="memp.html" title="Chapter 8. The DB_MPOOLFILE Handle" />
11 <link rel="prev" href="mempset_mp_max_openfd.html" title="DB_ENV->set_mp_max_openfd()" />
12 <link rel="next" href="envset_mp_mmapsize.html" title="DB_ENV->set_mp_mmapsize()" />
15 <div xmlns="" class="navheader">
17 <p>Library Version 11.2.5.3</p>
19 <table width="100%" summary="Navigation header">
21 <th colspan="3" align="center">DB_ENV->set_mp_max_write()</th>
24 <td width="20%" align="left"><a accesskey="p" href="mempset_mp_max_openfd.html">Prev</a> </td>
25 <th width="60%" align="center">Chapter 8.
26 The DB_MPOOLFILE Handle
28 <td width="20%" align="right"> <a accesskey="n" href="envset_mp_mmapsize.html">Next</a></td>
33 <div class="sect1" lang="en" xml:lang="en">
34 <div class="titlepage">
37 <h2 class="title" style="clear: both"><a id="mempset_mp_max_write"></a>DB_ENV->set_mp_max_write()</h2>
41 <pre class="programlisting">#include <db.h>
44 DB_ENV->set_mp_max_write(DB_ENV *env, int maxwrite,
45 db_timeout_t maxwrite_sleep); </pre>
47 The <code class="methodname">DB_ENV->set_mp_max_write()</code> method limits the number of sequential
48 write operations scheduled by the library when flushing dirty pages
52 The database environment's maximum number of sequential write
53 operations may also be configured using the environment's
54 <a href="../../programmer_reference/env_db_config.html#env_db_config.DB_CONFIG" class="olink">DB_CONFIG</a> file. The syntax of the entry in that file is a single
55 line with the string "set_mp_max_write", one or more whitespace
56 characters, and the maximum number of sequential writes and the
57 number of microseconds to sleep, also separated by whitespace
58 characters. 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 database
59 environment is opened, it will silently overrule configuration
60 done before that time.
63 The <code class="methodname">DB_ENV->set_mp_max_write()</code> method configures a database
64 environment, not only operations performed using the specified
65 <a class="link" href="env.html" title="Chapter 5. The DB_ENV Handle">DB_ENV</a> handle.
68 The <code class="methodname">DB_ENV->set_mp_max_write()</code> <span>
70 method returns a non-zero error value on failure and 0 on success.
75 <div class="sect2" lang="en" xml:lang="en">
76 <div class="titlepage">
79 <h3 class="title"><a id="idp61335456"></a>Parameters</h3>
83 <div class="sect3" lang="en" xml:lang="en">
84 <div class="titlepage">
87 <h4 class="title"><a id="idp61335928"></a>maxwrite</h4>
92 The maximum number of sequential write operations scheduled by the
93 library when flushing dirty pages from the cache, or 0 if there is no
94 limitation on the number of sequential write operations.
97 <div class="sect3" lang="en" xml:lang="en">
98 <div class="titlepage">
101 <h4 class="title"><a id="idp61345424"></a>maxwrite_sleep</h4>
106 The number of microseconds the thread of control should pause before
107 scheduling further write operations. It must be specified as an
108 unsigned 32-bit number of microseconds, limiting the maximum pause to
113 <div class="sect2" lang="en" xml:lang="en">
114 <div class="titlepage">
117 <h3 class="title"><a id="idp61336096"></a>Errors</h3>
122 The <code class="methodname">DB_ENV->set_mp_max_write()</code> <span>
124 method may fail and return one of the following non-zero errors:
129 <div class="sect3" lang="en" xml:lang="en">
130 <div class="titlepage">
133 <h4 class="title"><a id="idp61327296"></a>EINVAL</h4>
138 An invalid flag value or parameter was specified.
142 <div class="sect2" lang="en" xml:lang="en">
143 <div class="titlepage">
146 <h3 class="title"><a id="idp61325208"></a>Class</h3>
151 <a class="link" href="env.html" title="Chapter 5. The DB_ENV Handle">DB_ENV</a>, <a class="link" href="memp.html" title="Chapter 8. The DB_MPOOLFILE Handle">DB_MPOOLFILE</a>
154 <div class="sect2" lang="en" xml:lang="en">
155 <div class="titlepage">
158 <h3 class="title"><a id="idp61339248"></a>See Also</h3>
163 <a class="xref" href="memp.html#memplist" title="Memory Pools and Related Methods">Memory Pools and Related Methods</a>
167 <div class="navfooter">
169 <table width="100%" summary="Navigation footer">
171 <td width="40%" align="left"><a accesskey="p" href="mempset_mp_max_openfd.html">Prev</a> </td>
172 <td width="20%" align="center">
173 <a accesskey="u" href="memp.html">Up</a>
175 <td width="40%" align="right"> <a accesskey="n" href="envset_mp_mmapsize.html">Next</a></td>
178 <td width="40%" align="left" valign="top">DB_ENV->set_mp_max_openfd() </td>
179 <td width="20%" align="center">
180 <a accesskey="h" href="index.html">Home</a>
182 <td width="40%" align="right" valign="top"> DB_ENV->set_mp_mmapsize()</td>