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_tas_spins()</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_max.html" title="DbEnv::mutex_set_max()" /> 12 <link rel="next" href="mutexstat.html" title="DbEnv::mutex_stat()" /> 13 </head> 14 <body> 15 <div class="navheader"> 16 <table width="100%" summary="Navigation header"> 17 <tr> 18 <th colspan="3" align="center">DbEnv::mutex_set_tas_spins()</th> 19 </tr> 20 <tr> 21 <td width="20%" align="left"><a accesskey="p" href="mutexset_max.html">Prev</a>��</td> 22 <th width="60%" align="center">Chapter��10.�� 23 Mutex Methods 24 </th> 25 <td width="20%" align="right">��<a accesskey="n" href="mutexstat.html">Next</a></td> 26 </tr> 27 </table> 28 <hr /> 29 </div> 30 <div class="sect1" lang="en" xml:lang="en"> 31 <div class="titlepage"> 32 <div> 33 <div> 34 <h2 class="title" style="clear: both"><a id="mutexset_tas_spins"></a>DbEnv::mutex_set_tas_spins()</h2> 35 </div> 36 </div> 37 </div> 38 <pre class="programlisting">#include <db_cxx.h> 39 40int 41DbEnv::mutex_set_tas_spins(u_int32_t tas_spins); </pre> 42 <p> 43 Specify that test-and-set mutexes should spin <span class="bold"><strong>tas_spins</strong></span> times without blocking. The value 44 defaults to 1 on uniprocessor systems and to 50 times the number of 45 processors on multiprocessor systems. 46 </p> 47 <p> 48 The database environment's test-and-set spin count may also be 49 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 50 syntax of the entry in that file is a single line with the string 51 "set_tas_spins", one or more whitespace characters, and the number of 52 spins. Because the <a href="../../programmer_reference/env_db_config.html#env_db_config.DB_CONFIG" class="olink">DB_CONFIG</a> file is 53 read when the database environment is opened, it will silently 54 overrule configuration done before that time. 55 </p> 56 <p> 57 The <code class="methodname">DbEnv::mutex_set_tas_spins()</code> method configures operations 58 performed using the specified 59 <a class="link" href="env.html" title="Chapter��5.�� The DbEnv Handle">DbEnv</a> handle, not all 60 operations performed on the underlying database environment. 61 </p> 62 <p> 63 The <code class="methodname">DbEnv::mutex_set_tas_spins()</code> method may be called at any time 64 during the life of the application. 65 </p> 66 <p> 67 The <code class="methodname">DbEnv::mutex_set_tas_spins()</code> <span> 68 69 <span> 70 method either returns a non-zero error value or throws an 71 exception that encapsulates a non-zero error value on 72 failure, and returns 0 on success. 73 </span> 74 </span> 75 </p> 76 <div class="sect2" lang="en" xml:lang="en"> 77 <div class="titlepage"> 78 <div> 79 <div> 80 <h3 class="title"><a id="id1699587"></a>Parameters</h3> 81 </div> 82 </div> 83 </div> 84 <div class="sect3" lang="en" xml:lang="en"> 85 <div class="titlepage"> 86 <div> 87 <div> 88 <h4 class="title"><a id="id1699519"></a>tas_spins</h4> 89 </div> 90 </div> 91 </div> 92 <p> 93 The <span class="bold"><strong>tas_spins</strong></span> parameter is the number 94 of spins test-and-set mutexes should execute before blocking. 95 </p> 96 </div> 97 </div> 98 <div class="sect2" lang="en" xml:lang="en"> 99 <div class="titlepage"> 100 <div> 101 <div> 102 <h3 class="title"><a id="id1699845"></a>Errors</h3> 103 </div> 104 </div> 105 </div> 106 <p> 107 The <code class="methodname">DbEnv::mutex_set_tas_spins()</code> <span> 108 109 <span> 110 method may fail and throw a <a class="link" href="dbexception.html" title="Chapter��6.��The DbException Class">DbException</a> 111 exception, encapsulating one of the following non-zero errors, or return one 112 of the following non-zero errors: 113 </span> 114 </span> 115 </p> 116 <div class="sect3" lang="en" xml:lang="en"> 117 <div class="titlepage"> 118 <div> 119 <div> 120 <h4 class="title"><a id="id1699620"></a>EINVAL</h4> 121 </div> 122 </div> 123 </div> 124 <p> 125 An invalid flag value or parameter was specified. 126 </p> 127 </div> 128 </div> 129 <div class="sect2" lang="en" xml:lang="en"> 130 <div class="titlepage"> 131 <div> 132 <div> 133 <h3 class="title"><a id="id1699560"></a>Class</h3> 134 </div> 135 </div> 136 </div> 137 <p> 138 <a class="link" href="env.html" title="Chapter��5.�� The DbEnv Handle">DbEnv</a> 139 </p> 140 </div> 141 <div class="sect2" lang="en" xml:lang="en"> 142 <div class="titlepage"> 143 <div> 144 <div> 145 <h3 class="title"><a id="id1699777"></a>See Also</h3> 146 </div> 147 </div> 148 </div> 149 <p> 150 <a class="xref" href="mutex.html#mutexlist" title="Mutex Methods">Mutex Methods</a> 151 </p> 152 </div> 153 </div> 154 <div class="navfooter"> 155 <hr /> 156 <table width="100%" summary="Navigation footer"> 157 <tr> 158 <td width="40%" align="left"><a accesskey="p" href="mutexset_max.html">Prev</a>��</td> 159 <td width="20%" align="center"> 160 <a accesskey="u" href="mutex.html">Up</a> 161 </td> 162 <td width="40%" align="right">��<a accesskey="n" href="mutexstat.html">Next</a></td> 163 </tr> 164 <tr> 165 <td width="40%" align="left" valign="top">DbEnv::mutex_set_max()��</td> 166 <td width="20%" align="center"> 167 <a accesskey="h" href="index.html">Home</a> 168 </td> 169 <td width="40%" align="right" valign="top">��DbEnv::mutex_stat()</td> 170 </tr> 171 </table> 172 </div> 173 </body> 174</html> 175