mdb_env_set_maxreaders function

int mdb_env_set_maxreaders(
  1. Pointer<MDB_env> env,
  2. int readers
)

@brief Set the maximum number of threads/reader slots for the environment.

This defines the number of slots in the lock table that is used to track readers in the the environment. The default is 126. Starting a read-only transaction normally ties a lock table slot to the current thread until the environment closes or the thread exits. If MDB_NOTLS is in use, #mdb_txn_begin() instead ties the slot to the MDB_txn object until it or the #MDB_env object is destroyed. This function may only be called after #mdb_env_create() and before #mdb_env_open(). @paramin env An environment handle returned by #mdb_env_create() @paramin readers The maximum number of reader lock table slots @return A non-zero error value on failure and 0 on success. Some possible errors are:

  • EINVAL - an invalid parameter was specified, or the environment is already open.

Implementation

@ffi.FfiNative<ffi.Int Function(ffi.Pointer<MDB_env>, ffi.UnsignedInt)>(
    'mdb_env_set_maxreaders')
external int mdb_env_set_maxreaders(
  ffi.Pointer<MDB_env> env,
  int readers,
);