DbEnv::set_region_init

APIRef

#include <db_cxx.h>

int DbEnv::set_region_init(int region_init);

Description

In some applications, the expense of page-faulting the shared memory regions can affect performance, e.g., when the page-fault occurs while holding a lock, other lock requests can convoy and overall throughput may decrease. Setting region_init to a non-zero value specifies that shared regions be read or written, as appropriate, when the region is joined by the application.

This forces the underlying virtual memory and file systems to instantiate both the necessary memory and the necessary disk space. This can avoid out-of-disk space failures later on.

The DbEnv::set_region_init interface may only be used to configure Berkeley DB before the DbEnv::open interface is called.

The DbEnv::set_region_init 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.

Errors

EINVAL
An invalid flag value or parameter was specified.

Called after DbEnv::open was called.

Class

DbEnv

See Also

DbEnv::close, DbEnv::open, DbEnv::remove, DbEnv::err, DbEnv::strerror, DbEnv::version, DbEnv::set_cachesize, DbEnv::set_errcall, DbEnv::set_errfile, DbEnv::set_error_stream, DbEnv::set_errpfx, DbEnv::set_paniccall, DbEnv::set_region_init and DbEnv::set_verbose.

APIRef

Copyright Sleepycat Software