diff options
Diffstat (limited to 'sql/threadpool.h')
-rw-r--r-- | sql/threadpool.h | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/sql/threadpool.h b/sql/threadpool.h index 817681e174f..27da872c5cc 100644 --- a/sql/threadpool.h +++ b/sql/threadpool.h @@ -1,8 +1,4 @@ -#ifndef THREADPOOL_H_INCLUDED -#define THREADPOOL_H_INCLUDED - -#ifdef HAVE_POOL_OF_THREADS -/* Copyright (C) 2012 Monty Program Ab +/* Copyright (C) 2012, 2020, MariaDB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,6 +13,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ +#pragma once +#ifdef HAVE_POOL_OF_THREADS #define MAX_THREAD_GROUPS 100000 /* Threadpool parameters */ @@ -24,16 +22,19 @@ extern uint threadpool_min_threads; /* Minimum threads in pool */ extern uint threadpool_idle_timeout; /* Shutdown idle worker threads after this timeout */ extern uint threadpool_size; /* Number of parallel executing threads */ extern uint threadpool_max_size; -extern uint threadpool_stall_limit; /* time interval in 10 ms units for stall checks*/ +extern uint threadpool_stall_limit; /* time interval in milliseconds for stall checks*/ extern uint threadpool_max_threads; /* Maximum threads in pool */ extern uint threadpool_oversubscribe; /* Maximum active threads in group */ extern uint threadpool_prio_kickup_timer; /* Time before low prio item gets prio boost */ +extern my_bool threadpool_exact_stats; /* Better queueing time stats for information_schema, at small performance cost */ +extern my_bool threadpool_dedicated_listener; /* Listener thread does not pick up work items. */ #ifdef _WIN32 extern uint threadpool_mode; /* Thread pool implementation , windows or generic */ #define TP_MODE_WINDOWS 0 #define TP_MODE_GENERIC 1 #endif +#define DEFAULT_THREADPOOL_STALL_LIMIT 500U struct TP_connection; extern void tp_callback(TP_connection *c); @@ -61,11 +62,6 @@ extern void tp_set_threadpool_stall_limit(uint val); extern int tp_get_idle_thread_count(); extern int tp_get_thread_count(); -/* Activate threadpool scheduler */ -extern void tp_scheduler(void); - -extern int show_threadpool_idle_threads(THD *thd, SHOW_VAR *var, char *buff, - enum enum_var_type scope); enum TP_PRIORITY { TP_PRIORITY_HIGH, @@ -89,6 +85,8 @@ enum TP_STATE inside threadpool_win.cc and threadpool_unix.cc */ +class CONNECT; + struct TP_connection { THD* thd; @@ -138,7 +136,7 @@ struct TP_pool #ifdef _WIN32 struct TP_pool_win:TP_pool { - TP_pool_win(); + TP_pool_win(); virtual int init(); virtual ~TP_pool_win(); virtual TP_connection *new_connection(CONNECT *c); @@ -161,4 +159,3 @@ struct TP_pool_generic :TP_pool }; #endif /* HAVE_POOL_OF_THREADS */ -#endif /* THREADPOOL_H_INCLUDED */ |