MySQL 9.1.0
Source Code Documentation
|
This class represents the connection handling functionality that each connection is being handled in a single thread. More...
#include <connection_handler_impl.h>
Public Member Functions | |
Per_thread_connection_handler ()=default | |
~Per_thread_connection_handler () override=default | |
Static Public Member Functions | |
static void | init () |
static void | destroy () |
static void | kill_blocked_pthreads () |
Wake blocked pthreads and wait until they have terminated. More... | |
static Channel_info * | block_until_new_connection () |
Block until a new connection arrives. More... | |
static void | modify_thread_cache_size (const ulong thread_cache_size) |
Modify the thread cache size. More... | |
static ulong | get_blocked_pthread_count () |
Return blocked threads count. More... | |
Static Public Attributes | |
static ulong | blocked_pthread_count = 0 |
static ulong | slow_launch_threads = 0 |
static bool | shrink_cache = false |
static ulong | max_blocked_pthreads = 0 |
Protected Member Functions | |
bool | add_connection (Channel_info *channel_info) override |
Add a connection. More... | |
uint | get_max_threads () const override |
Protected Member Functions inherited from Connection_handler | |
Connection_handler ()=default | |
virtual | ~Connection_handler ()=default |
Private Member Functions | |
Per_thread_connection_handler (const Per_thread_connection_handler &) | |
Per_thread_connection_handler & | operator= (const Per_thread_connection_handler &) |
bool | check_idle_thread_and_enqueue_connection (Channel_info *channel_info) |
Check if idle threads to handle connection in thread cache. More... | |
Static Private Attributes | |
static std::list< Channel_info * > * | waiting_channel_info_list = nullptr |
List of pending channel info objects to be picked by idle threads. More... | |
static mysql_mutex_t | LOCK_thread_cache |
static mysql_cond_t | COND_thread_cache |
static mysql_cond_t | COND_flush_thread_cache |
This class represents the connection handling functionality that each connection is being handled in a single thread.
|
private |
|
default |
|
overridedefault |
|
overrideprotectedvirtual |
Add a connection.
channel_info | Pointer to the Channel_info object. |
Implements Connection_handler.
|
static |
Block until a new connection arrives.
Block the current pthread for reuse by new connections.
NULL | Too many pthreads blocked already or shutdown in progress. |
!NULL | Pointer to Channel_info object representing the new connection to be served by this pthread. |
|
private |
Check if idle threads to handle connection in thread cache.
If so enqueue the new connection to be picked by the idle thread in thread cache.
false | if idle pthread was found, else true. |
|
static |
|
static |
Return blocked threads count.
|
overrideprotectedvirtual |
Implements Connection_handler.
|
static |
|
static |
Wake blocked pthreads and wait until they have terminated.
|
static |
Modify the thread cache size.
thread_cache_size | size of thread cache. |
|
private |
|
static |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
static |
|
static |
|
static |
|
staticprivate |
List of pending channel info objects to be picked by idle threads.
Protected by LOCK_thread_cache.