MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
srv0conc.cc File Reference
#include "srv0srv.h"
#include "sync0sync.h"
#include "trx0trx.h"
#include "mysql/plugin.h"
Include dependency graph for srv0conc.cc:

Go to the source code of this file.

Classes

struct  srv_conc_slot_t
struct  srv_conc_t

Functions

typedef UT_LIST_NODE_T (struct srv_conc_slot_t) srv_conc_node_t
typedef UT_LIST_BASE_NODE_T (srv_conc_slot_t) srv_conc_queue_t
void srv_conc_init (void)
void srv_conc_free (void)
UNIV_INTERN void srv_conc_enter_innodb (trx_t *trx)
UNIV_INTERN void srv_conc_force_enter_innodb (trx_t *trx)
UNIV_INTERN void srv_conc_force_exit_innodb (trx_t *trx)
UNIV_INTERN ulint srv_conc_get_waiting_threads (void)
UNIV_INTERN ulint srv_conc_get_active_threads (void)

Variables

UNIV_INTERN ulong srv_n_free_tickets_to_enter = 500
UNIV_INTERN ulong srv_thread_sleep_delay = 10000
UNIV_INTERN ulint srv_max_n_threads = 0
UNIV_INTERN ulong srv_thread_concurrency = 0

Detailed Description

InnoDB concurrency manager

Created 2011/04/18 Sunny Bains

Definition in file srv0conc.cc.

Function Documentation

UNIV_INTERN void srv_conc_enter_innodb ( trx_t trx)

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
trxin: transaction object associated with the thread

Definition at line 501 of file srv0conc.cc.

UNIV_INTERN 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.

Parameters
trxin: transaction object associated with the thread

Definition at line 522 of file srv0conc.cc.

Here is the caller graph for this function:

UNIV_INTERN 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.

Parameters
trxin: transaction object associated with the thread

Definition at line 555 of file srv0conc.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

void srv_conc_free ( void  )

Free the concurrency management data structures

Definition at line 155 of file srv0conc.cc.

Here is the caller graph for this function:

UNIV_INTERN ulint srv_conc_get_active_threads ( void  )

Get the count of threads active inside InnoDB.

Definition at line 592 of file srv0conc.cc.

Here is the caller graph for this function:

UNIV_INTERN ulint srv_conc_get_waiting_threads ( void  )

Get the count of threads waiting inside InnoDB.

Definition at line 582 of file srv0conc.cc.

Here is the caller graph for this function:

void srv_conc_init ( void  )

Initialise the concurrency management data structures

Definition at line 128 of file srv0conc.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

typedef UT_LIST_BASE_NODE_T ( srv_conc_slot_t  )

Queue of threads waiting to get in

typedef UT_LIST_NODE_T ( struct srv_conc_slot_t  )

Concurrency list node

Variable Documentation

UNIV_INTERN ulint srv_max_n_threads = 0
We are prepared for a situation that we have this many threads waiting for

a semaphore inside InnoDB. innobase_start_or_create_for_mysql() sets the value.

Definition at line 62 of file srv0conc.cc.

UNIV_INTERN ulong srv_n_free_tickets_to_enter = 500
Number of times a thread is allowed to enter InnoDB within the same

SQL query after it has once got the ticket.

Definition at line 48 of file srv0conc.cc.

UNIV_INTERN ulong srv_thread_concurrency = 0
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.

Definition at line 68 of file srv0conc.cc.

UNIV_INTERN ulong srv_thread_sleep_delay = 10000

Sleep delay for threads waiting to enter InnoDB. In micro-seconds.

Definition at line 55 of file srv0conc.cc.