Hi Roberto,
The structures you need are in sql/threadpool_unix.cc
Global all_groups array contains all thread groups . Every thread_group_t has list of waiting threads , called “waiting_threads”, and queue of not yet handled requests, called “queue” (request is represented by connection_t ), a listener etc.
“Active” connections, i.e connections that currently are executing queries , can neither be found in threadpool’s waiting_threads, nor there is a different “active” list for them. So you may want to introduce special handling for those (i.e iterate the global “threads” list looking for active connections, get corresponding connection_t* struct from thd->event_scheduler.data, and do something with it, e.g look which thread group it belongs)
On Windows, I doubt you can implement any information_schema plugin for the threadpool. This is because threadpool is native OS threadpool, and OS structure representing it PTP_POOL structure is opaque, and there is not much info you can extract from it (well, maybe you can , if you debug with a kernel debugger, but not otherwise)
Wlad
From: Maria-developers [mailto:maria-developers-bounces+wlad=montyprogram.com@lists.launchpad.net] On Behalf Of Roberto Spadim
Sent: Montag, 16. September 2013 21:20
To: maria-developers@lists.launchpad.net
Subject: [Maria-developers] MDEV-5019 - THREADPOOL - Create Information Schema Table for Threadpool
Hi guys!
I openned a new MDEV https://mariadb.atlassian.net/browse/MDEV-5019 the idea is expose the threadpool group information like oracle thread pool (more information about oracle thread pool here: http://mikaelronstrom.blogspot.com.br/2011_10_01_archive.html)
I can help, but i don't know how access the threadpool at scheduler.h/scheduler.c from a information schema plugin
1) lock important mutex and others mdl
2) acess variables
3) write information schema based on variables
1 and 2 i don't know how to do :(
can anyone help ? :)
thanks guys :)
--
Roberto Spadim