下面是当thread group 有多个threads 活跃时举出的实例:
1、一个线程执行一个statement,但是时间已经超过了 stalled time,thread group 会 开启一个新的thread 来执行其他的statement,设置当第一个语句还在执行过程中。。
2、一个线程正在执行一个statement,然后被 blocked并被thread pool 检测到,这个时候此时 该 thread group 允许开启一个新的线程来执行另一个statement。
3、一个线程正在执行一个statement,然后被blocked但没有被 thread pool检测到,这个时候只有等到 stalled 时间 才能开启一个新的线程来执行新的statement
在某些线程 被blocked 但不被thread pool 检测到 但也不会阻止其他语句的执行也不会造成thread pool 死锁 这些情况是很重要的。
1、长时间运行的statement,
2、Binary log dump threads
3、Statements blocked on a row lock, table lock, sleep, or any other blocking activity that has not been reported back to the thread pool by MySQL Server or a storage engine.
以上情况,为防止死锁的产生,该statement 都会被放到stalled 类别对待,
最大的线程数是the sum of max_connections and thread_pool_size
