MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
service_thd_wait.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  thd_wait_service_st

Typedefs

typedef enum _thd_wait_type_e thd_wait_type

Enumerations

enum  _thd_wait_type_e {
  THD_WAIT_SLEEP = 1, THD_WAIT_DISKIO = 2, THD_WAIT_ROW_LOCK = 3, THD_WAIT_GLOBAL_LOCK = 4,
  THD_WAIT_META_DATA_LOCK = 5, THD_WAIT_TABLE_LOCK = 6, THD_WAIT_USER_LOCK = 7, THD_WAIT_BINLOG = 8,
  THD_WAIT_GROUP_COMMIT = 9, THD_WAIT_SYNC = 10, THD_WAIT_LAST = 11
}

Functions

void thd_wait_begin (MYSQL_THD thd, int wait_type)
void thd_wait_end (MYSQL_THD thd)

Variables

struct thd_wait_service_stthd_wait_service

Detailed Description

This service provides functions for plugins and storage engines to report when they are going to sleep/stall.

SYNOPSIS thd_wait_begin() - call just before a wait begins thd Thread object Use NULL if the thd is NOT known. wait_type Type of wait 1 – short wait (e.g. for mutex) 2 – medium wait (e.g. for disk io) 3 – large wait (e.g. for locked row/table) NOTES This is used by the threadpool to have better knowledge of which threads that currently are actively running on CPUs. When a thread reports that it's going to sleep/stall, the threadpool scheduler is free to start another thread in the pool most likely. The expected wait time is simply an indication of how long the wait is expected to become, the real wait time could be very different.

thd_wait_end() called immediately after the wait is complete

thd_wait_end() MUST be called if thd_wait_begin() was called.

Using thd_wait_...() service is optional but recommended. Using it will improve performance as the thread pool will be more active at managing the thread workload.

Definition in file service_thd_wait.h.

Function Documentation

void thd_wait_begin ( MYSQL_THD  thd,
int  wait_type 
)

This is a unit test for the 'meta data locking' classes. It is written to illustrate how we can use Google Test for unit testing of MySQL code. For documentation on Google Test, see http://code.google.com/p/googletest/ and the contained wiki pages GoogleTestPrimer and GoogleTestAdvancedGuide. The code below should hopefully be (mostly) self-explanatory.

Definition at line 40 of file mdl-t.cc.

Here is the call graph for this function:

Here is the caller graph for this function: