MySQL 9.1.0
Source Code Documentation
srv0conc.h File Reference

InnoDB concurrency manager header file. More...

Go to the source code of this file.

Functions

dberr_t srv_conc_enter_innodb (row_prebuilt_t *prebuilt)
 Puts an OS thread to wait if there are too many concurrent threads (>= srv_thread_concurrency) inside InnoDB. More...
 
void srv_conc_force_enter_innodb (trx_t *trx)
 This lets a thread enter InnoDB regardless of the number of threads inside InnoDB. More...
 
void srv_conc_force_exit_innodb (trx_t *trx)
 This must be called when a thread exits InnoDB in a lock wait or at the end of an SQL statement. More...
 
int32_t srv_conc_get_waiting_threads (void)
 Get the count of threads waiting inside InnoDB. More...
 
int32_t srv_conc_get_active_threads (void)
 Get the count of threads active inside InnoDB. More...
 

Variables

uint32_t srv_max_n_threads
 We are prepared for a situation that we have this many threads waiting for a semaphore inside InnoDB. More...
 
ulong srv_thread_concurrency
 The following controls how many threads we let inside InnoDB concurrently: threads waiting for locks are not counted into the number because otherwise we could get a deadlock. More...
 

Detailed Description

InnoDB concurrency manager header file.

Created 2011/04/18 Sunny Bains

Function Documentation

◆ srv_conc_enter_innodb()

dberr_t srv_conc_enter_innodb ( row_prebuilt_t prebuilt)

Puts an OS thread to wait if there are too many concurrent threads (>= srv_thread_concurrency) inside InnoDB.

The threads wait in a FIFO queue.

Parameters
[in,out]prebuiltrow prebuilt handler
Returns
Innodb error code.

◆ srv_conc_force_enter_innodb()

void srv_conc_force_enter_innodb ( trx_t trx)

This lets a thread enter InnoDB regardless of the number of threads inside InnoDB.

This must be called when a thread ends a lock wait. in: transaction object associated with the thread

This must be called when a thread ends a lock wait.

Parameters
trxin: transaction object associated with the thread

◆ srv_conc_force_exit_innodb()

void srv_conc_force_exit_innodb ( trx_t trx)

This must be called when a thread exits InnoDB in a lock wait or at the end of an SQL statement.

in: transaction object associated with the thread

Parameters
trxin: transaction object associated with the thread

◆ srv_conc_get_active_threads()

int32_t srv_conc_get_active_threads ( void  )

Get the count of threads active inside InnoDB.

◆ srv_conc_get_waiting_threads()

int32_t srv_conc_get_waiting_threads ( void  )

Get the count of threads waiting inside InnoDB.

Variable Documentation

◆ srv_max_n_threads

uint32_t srv_max_n_threads
extern

We are prepared for a situation that we have this many threads waiting for a semaphore inside InnoDB.

Maximum number of threads inside InnoDB.

innodb_init_params() sets the value.

◆ srv_thread_concurrency

ulong srv_thread_concurrency
extern

The following controls how many threads we let inside InnoDB concurrently: threads waiting for locks are not counted into the number because otherwise we could get a deadlock.

Value of 0 will disable the concurrency check.