summaryrefslogtreecommitdiff
path: root/sql/threadpool_common.cc
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch '10.1' into 10.2Sergei Golubchik2016-09-091-2/+1
|\
| * MDEV-10314 : wsrep_client_thread was not set in threadpool.Vladislav Vaintroub2016-07-191-2/+1
| | | | | | | | | | Fixed threadpool_add_connection to use thd_prepare_connection() to match thread-per-conection flow.
* | cleanup: thread_countSergei Golubchik2016-06-041-1/+0
| | | | | | | | | | | | | | move thread_count handling into THD: * increment thread_count in THD constructor * decrement thread_count in THD destructor * never modify thread_count directly!
* | decrement thead_count *after* THD is destroyedSergei Golubchik2016-06-041-1/+1
| | | | | | | | | | | | | | | | because thread_count means just that: number of THDs and shutdown code looks at it to know when to free shared data structures that THD uses. This fixes random crashes in ~THD on shutdown
* | Reuse THD for new user connectionsMonty2016-06-041-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - To ensure that mallocs are marked for the correct THD, even if it's allocated in another thread, I added the thread_id to the THD constructor - Added st_my_thread_var to thr_lock_info_init() to avoid a call to my_thread_var - Moved things from THD::THD() to THD::init() - Moved some things to THD::cleanup() - Added THD::free_connection() and THD::reset_for_reuse() - Added THD to CONNECT::create_thd() - Added THD::thread_dbug_id and st_my_thread_var->dbug_id. These are needed to ensure that we have a constant thread_id used for debugging with a THD, even if it changes thread_id (=connection_id) - Set variables.pseudo_thread_id in constructor. Removed not needed sets.
* | Fix leak from missing my_thread_endVladislav Vaintroub2016-03-091-16/+7
| |
* | Fix threadpool memory leak and connect2 testVladislav Vaintroub2016-03-091-1/+7
| |
* | Fix threadpool after it was broken by MDEV-6150Vladislav Vaintroub2016-03-081-9/+25
| |
* | Fix compilation10.2-sslVladislav Vaintroub2016-02-101-0/+13
| |
* | MDEV-6150 Speed up connection speed by moving creation of THD to new threadMonty2016-02-071-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Creating a CONNECT object on client connect and pass this to the working thread which creates the THD. Split LOCK_thread_count to different mutexes Added LOCK_thread_start to syncronize threads Moved most usage of LOCK_thread_count to dedicated functions Use next_thread_id() instead of thread_id++ Other things: - Thread id now starts from 1 instead of 2 - Added cast for thread_id as thread id is now of type my_thread_id - Made THD->host const (To ensure it's not changed) - Removed some DBUG_PRINT() about entering/exiting mutex as these was already logged by mutex code - Fixed that aborted_connects and connection_errors_internal are counted in all cases - Don't take locks for current_linfo when we set it (not needed as it was 0 before)
* | Merge remote-tracking branch 'origin/10.1' into 10.2Alexander Barkov2015-12-291-9/+15
|\ \ | |/
| * MDEV-9156 : Fix tp_add_connection()'s error handlingVladislav Vaintroub2015-12-041-9/+15
| | | | | | | | Avoid possible my_thread_end() in the main polling thread.
* | MDEV-8715 - Obsolete sql_alloc() in favor of THD::alloc() and thd_alloc()Sergey Vojtovich2015-11-261-1/+0
|/ | | | | | | | | | | | | | The following left in semi-improved state to keep patch size reasonable: - Field operator new: left thd_alloc(current_thd) - Sql_alloc operator new: left thd_alloc(thd_get_current_thd()) - Item_args constructors: left thd_alloc(thd) - Item_func_interval::fix_length_and_dec(): no THD arg, have to call current_thd - Item_func_dyncol_exists::val_int(): same - Item_dyncol_get::val_str(): same - Item_dyncol_get::val_int(): same - Item_dyncol_get::val_real(): same - Item_dyncol_get::val_decimal(): same - Item_singlerow_subselect::fix_length_and_dec(): same
* MDEV-5205 - MariaDB does not start if more than 128 cpu's are availableSergey Vojtovich2013-11-051-0/+1
| | | | | | | | | | | - thread_pool_size command line option upper limit increased to 100 000 (same as for max_connections) - thread_pool_size system variable upper limit is maximum of 128 or the value given at command line - thread groups are now allocated dynamically Different limit for command line option and system variable was done to avoid additional mutex for all_groups and threadpool_max_size.
* MDEV-4685 Compile error on LFSSergei Golubchik2013-06-221-0/+8
| | | | fix the code to compile w/o perfomance schema
* MDEV-3945 - do not hold LOCK_thread_count when freeing THD.Vladislav Vaintroub2012-12-211-1/+0
| | | | | | | | | The patch decreases the duration of LOCK_thread_count, so it is not hold during THD destructor and freeing memory. This mutex now only protects the integrity of threads list, when removing THD from it, and thread_count variable. The add_to_status() function that updates global status during client disconnect, is now correctly protected by the LOCK_status mutex. Benchmark : in a "non-persistent" sysbench test (oltp_ro with reconnect after each query), ~ 25% more connects/disconnects were measured
* MDEV-531 : Warning: Forcing close of thread ... in rpl_binlog_indexVladislav Vaintroub2012-11-021-1/+1
| | | | | | Use post_kill_notification in for one_thread_per_connection scheduler, the same as already used in threadpool, to reliably wake a thread stuck in read() or in different poll() variations.
* MDEV-246 - Aborted_clients incremented during ordinary connection closeVladislav Vaintroub2012-05-031-1/+0
| | | | | | The problem was increment of aborted_threads variable due to thd->killed which was set when threadpool connection was terminated . The fix is not to set thd->killed anymore, there is no real reason for doing it.. Added a test that checks that status variable aborted_clients does not grow for ordinary disconnects, and that successful KILL increments this variable.
* Added copiright, some more commentsVladislav Vaintroub2012-02-171-0/+27
|
* address second round review commentsVladislav Vaintroub2012-02-161-9/+9
|
* Threadpool : Rest of monty's reviewVladislav Vaintroub2012-01-271-4/+0
|
* small cleanupsVladislav Vaintroub2012-01-241-0/+3
|
* Threadpool -address review commentsVladislav Vaintroub2012-01-151-46/+33
|
* Simplify thread attach/detach. Use connection specific mysys_var, rather ↵Vladislav Vaintroub2012-01-131-77/+92
| | | | than sharing worker thread's my_thread_var with THD.
* Allow for faster creation of threads in corner cases where pool would be ↵Vladislav Vaintroub2011-12-311-0/+1
| | | | | | | | overloaded with long non-yielding queries. To allow it, change minimum of thread_pool_stall_limit to be 10 milliseconds. Also introduce a new parameter to oversubscribe a group . Number of threads running in parallel would be higher than it normally should, leading to thrashing, but it may improving preemptiveness, which is useful for the described corner case.
* fix test suiteVladislav Vaintroub2011-12-271-1/+3
|
* Small adjustements to threadpoolVladislav Vaintroub2011-12-181-4/+2
|
* Initial threadpool implementation for MariaDB 5.5Vladislav Vaintroub2011-12-081-0/+246