2
<!--Copyright 1997-2002 by Sleepycat Software, Inc.-->
3
<!--All rights reserved.-->
4
<!--See the file LICENSE for redistribution information.-->
7
<title>Berkeley DB: DbEnv::set_tas_spins</title>
8
<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
9
<meta name="keywords" content="embedded,database,programmatic,toolkit,b+tree,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,java,C,C++">
12
<a name="2"><!--meow--></a>
13
<table width="100%"><tr valign=top>
15
<h1>DbEnv::set_tas_spins</h1>
18
<a href="../api_cxx/c_index.html"><img src="../images/api.gif" alt="API"></a><a href="../reftoc.html"><img src="../images/ref.gif" alt="Ref"></a>
23
#include <db_cxx.h>
26
DbEnv::set_tas_spins(u_int32_t tas_spins);
29
<p>Specify that test-and-set mutexes should spin <b>tas_spins</b> times
30
without blocking. The value defaults to 1 on uniprocessor systems and
31
to 50 times the number of processors on multiprocessor systems.
32
<p>The DbEnv::set_tas_spins method configures operations performed using the specified
33
<a href="../api_cxx/env_class.html">DbEnv</a> handle, not all operations performed on the underlying
35
<p>The DbEnv::set_tas_spins interface may be called at any time during the life of
37
<p>The DbEnv::set_tas_spins method either returns a non-zero error value or throws an exception that
38
encapsulates a non-zero error value on failure, and returns 0 on success.
39
<p>The database environment's test-and-set spin count may also be set using the environment's
40
<b>DB_CONFIG</b> file. The syntax of the entry in that file is a
41
single line with the string "set_tas_spins", one or more whitespace characters,
42
and the number of spins. Because the <b>DB_CONFIG</b> file is read when the database
43
environment is opened, it will silently overrule configuration done
46
<p>The DbEnv::set_tas_spins method may fail and throw an exception or return a non-zero error for the following conditions:
48
<p><dt>EINVAL<dd>An invalid flag value or parameter was specified.
50
<p>The DbEnv::set_tas_spins method may fail and throw an exception or return a non-zero error for errors specified for other Berkeley DB and C library or system methods.
51
If a catastrophic error has occurred, the DbEnv::set_tas_spins method may fail and
52
either return <a href="../ref/program/errorret.html#DB_RUNRECOVERY">DB_RUNRECOVERY</a> or throw a
53
<a href="../api_cxx/runrec_class.html">DbRunRecoveryException</a>,
54
in which case all subsequent Berkeley DB calls will fail in the same way.
56
<a href="../api_cxx/env_class.html">DbEnv</a>
58
<a href="../api_cxx/env_list.html">Database Environments and Related Methods</a>
60
<table width="100%"><tr><td><br></td><td align=right>
61
<a href="../api_cxx/c_index.html"><img src="../images/api.gif" alt="API"></a><a href="../reftoc.html"><img src="../images/ref.gif" alt="Ref"></a>
63
<p><font size=1><a href="http://www.sleepycat.com">Copyright Sleepycat Software</a></font>