From dea3152c92344abac1b7a08a8765a802a5dcdce2 Mon Sep 17 00:00:00 2001 From: Mikael Ronstrom Date: Wed, 27 Oct 2010 20:35:01 +0200 Subject: [PATCH] Added more comments to THD wait service --- include/mysql/service_thd_wait.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/include/mysql/service_thd_wait.h b/include/mysql/service_thd_wait.h index 188aa0ab126..6f91c0acf43 100644 --- a/include/mysql/service_thd_wait.h +++ b/include/mysql/service_thd_wait.h @@ -50,6 +50,19 @@ extern "C" { #endif +/* + One should only report wait events that could potentially block for a + long time. A mutex wait is too short of an event to report. The reason + is that an event which is reported leads to a new thread starts + executing a query and this has a negative impact of usage of CPU caches + and thus the expected gain of starting a new thread must be higher than + the expected cost of lost performance due to starting a new thread. + + Good examples of events that should be reported are waiting for row locks + that could easily be for many milliseconds or even seconds and the same + holds true for global read locks, table locks and other meta data locks. + Another event of interest is going to sleep for an extended time. +*/ typedef enum _thd_wait_type_e { THD_WAIT_SLEEP= 1, THD_WAIT_DISKIO= 2,