1<!--$Id: mutex_set_tas_spins.so,v 10.30 2005/07/20 16:34:01 bostic Exp $--> 2<!--Copyright (c) 1997,2008 Oracle. All rights reserved.--> 3<!--See the file LICENSE for redistribution information.--> 4<html> 5<head> 6<title>Berkeley DB: DbEnv::mutex_set_tas_spins</title> 7<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit."> 8<meta name="keywords" content="embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++"> 9</head> 10<body bgcolor=white> 11<table width="100%"><tr valign=top> 12<td> 13<b>DbEnv::mutex_set_tas_spins</b> 14</td> 15<td align=right> 16<a href="../api_cxx/api_core.html"><img src="../images/api.gif" alt="API"></a> 17<a href="../ref/toc.html"><img src="../images/ref.gif" alt="Ref"></a></td> 18</tr></table> 19<hr size=1 noshade> 20<tt> 21<b><pre> 22#include <db_cxx.h> 23<p> 24int 25DbEnv::mutex_set_tas_spins(u_int32_t tas_spins); 26<p> 27int 28DbEnv::mutex_get_tas_spins(u_int32_t *, tas_spinsp); 29</pre></b> 30<hr size=1 noshade> 31<b>Description: DbEnv::mutex_set_tas_spins</b> 32<p>Specify that test-and-set mutexes should spin <b>tas_spins</b> times 33without blocking. The value defaults to 1 on uniprocessor systems and 34to 50 times the number of processors on multiprocessor systems.</p> 35<p>The database environment's test-and-set spin count may also be configured using the 36environment's <a href="../ref/env/db_config.html#DB_CONFIG">DB_CONFIG</a> file. The syntax of the entry in that 37file is a single line with the string "set_tas_spins", one or more whitespace 38characters, and the number of spins. 39Because the <a href="../ref/env/db_config.html#DB_CONFIG">DB_CONFIG</a> file is read when the database environment 40is opened, it will silently overrule configuration done before that 41time.</p> 42<p>The DbEnv::mutex_set_tas_spins method configures operations performed using the specified 43<a href="../api_cxx/env_class.html">DbEnv</a> handle, not all operations performed on the underlying 44database environment.</p> 45<p>The DbEnv::mutex_set_tas_spins method may be called at any time during the life of the 46application.</p> 47<p>The DbEnv::mutex_set_tas_spins method 48either returns a non-zero error value 49or throws an exception that encapsulates a non-zero error value on 50failure, and returns 0 on success. 51</p> 52<b>Parameters</b> <br> 53 <b>tas_spins</b><ul compact><li>The <b>tas_spins</b> parameter is the number of spins test-and-set 54mutexes should execute before blocking.</ul> 55<br> 56<br><b>Errors</b> 57<p>The DbEnv::mutex_set_tas_spins method 58may fail and throw 59<a href="../api_cxx/except_class.html">DbException</a>, 60encapsulating one of the following non-zero errors, or return one of 61the following non-zero errors:</p> 62<br> 63<b>EINVAL</b><ul compact><li>An 64invalid flag value or parameter was specified.</ul> 65<br> 66<hr size=1 noshade> 67<b>Description: DbEnv::mutex_get_tas_spins</b> 68<p>The DbEnv::mutex_get_tas_spins method returns the test-and-set spin count.</p> 69<p>The DbEnv::mutex_get_tas_spins method may be called at any time during the life of the 70application.</p> 71<p>The DbEnv::mutex_get_tas_spins method 72either returns a non-zero error value 73or throws an exception that encapsulates a non-zero error value on 74failure, and returns 0 on success. 75</p> 76<b>Parameters</b> <br> 77 <b>tas_spinsp</b><ul compact><li>The DbEnv::mutex_get_tas_spins method returns the 78test-and-set spin count in <b>tas_spinsp</b>.</ul> 79<br> 80<hr size=1 noshade> 81<br><b>Class</b> 82<a href="../api_cxx/env_class.html">DbEnv</a> 83<br><b>See Also</b> 84<a href="../api_cxx/env_list.html">Database Environments and Related Methods</a> 85</tt> 86<table width="100%"><tr><td><br></td><td align=right> 87<a href="../api_cxx/api_core.html"><img src="../images/api.gif" alt="API"></a><a href="../ref/toc.html"><img src="../images/ref.gif" alt="Ref"></a> 88</td></tr></table> 89<p><font size=1>Copyright (c) 1996,2008 Oracle. All rights reserved.</font> 90</body> 91</html> 92