DbEnv::set_thread_count

API Ref

#include <db_cxx.h>

int DbEnv::set_thread_count(u_int32_t count);

int DbEnv::get_thread_count(u_int32_t *countp);


Description: DbEnv::set_thread_count

Declare an approximate number of threads in the database environment. The DbEnv::set_thread_count method must be called prior to opening the database environment if the DbEnv::failchk method will be used. The DbEnv::set_thread_count method does not set the maximum number of threads but is used to determine memory sizing and the thread control block reclamation policy.

The database environment's thread count may also be configured using the environment's DB_CONFIG file. The syntax of the entry in that file is a single line with the string "set_thread_count", one or more whitespace characters, and the thread count. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

The DbEnv::set_thread_count method configures operations performed using the specified DbEnv handle, not all operations performed on the underlying database environment.

The DbEnv::set_thread_count method may not be called after the DbEnv::open method is called.

The DbEnv::set_thread_count method either returns a non-zero error value or throws an exception that encapsulates a non-zero error value on failure, and returns 0 on success.

Parameters

count
The count parameter is an approximate thread count for the database environment.

Errors

The DbEnv::set_thread_count method may fail and throw DbException, encapsulating one of the following non-zero errors, or return one of the following non-zero errors:

EINVAL
If the method was called after DbEnv::open was called; or if an invalid flag value or parameter was specified.

Description: DbEnv::get_thread_count

The DbEnv::get_thread_count method returns the thread count.

The DbEnv::get_thread_count method may be called at any time during the life of the application.

The DbEnv::get_thread_count method either returns a non-zero error value or throws an exception that encapsulates a non-zero error value on failure, and returns 0 on success.

Parameters

countp
The DbEnv::get_thread_count method returns the thread count in countp.

Class

DbEnv

See Also

Database Environments and Related Methods

APIRef

Copyright (c) 1996-2006 Oracle Corporation - All rights reserved.