Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
8d319b1f
Commit
8d319b1f
authored
Feb 10, 2011
by
Mikael Ronström
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplifications of server interface to scheduler
parent
af948cd6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
6 deletions
+30
-6
include/mysql/thread_pool_priv.h
include/mysql/thread_pool_priv.h
+17
-1
sql/scheduler.cc
sql/scheduler.cc
+10
-0
sql/scheduler.h
sql/scheduler.h
+3
-5
No files found.
include/mysql/thread_pool_priv.h
View file @
8d319b1f
...
...
@@ -34,11 +34,27 @@
*/
#define MYSQL_SERVER 1
#include <sql_class.h>
#include <scheduler.h>
#include <debug_sync.h>
#include <sql_profile.h>
#include <table.h>
struct
scheduler_functions
{
uint
max_threads
;
bool
(
*
init
)(
void
);
bool
(
*
init_new_connection_thread
)(
void
);
void
(
*
add_connection
)(
THD
*
thd
);
void
(
*
thd_wait_begin
)(
THD
*
thd
,
int
wait_type
);
void
(
*
thd_wait_end
)(
THD
*
thd
);
void
(
*
post_kill_notification
)(
THD
*
thd
);
bool
(
*
end_thread
)(
THD
*
thd
,
bool
cache_thread
);
void
(
*
end
)(
void
);
};
/* Needed to get access to scheduler variables */
void
*
thd_get_scheduler
(
THD
*
thd
);
PSI_thread
*
thd_get_psi
(
THD
*
thd
);
/*
The thread pool must be able to execute commands using the connection
state in THD object. This is the main objective of the thread pool to
...
...
sql/scheduler.cc
View file @
8d319b1f
...
...
@@ -160,6 +160,16 @@ thd_scheduler::~thd_scheduler()
{
}
void
*
thd_get_scheduler
(
THD
*
thd
)
{
return
thd
->
scheduler
.
data
;
}
PSI_thread
*
thd_get_psi
(
THD
*
thd
)
{
return
thd
->
scheduler
.
m_psi
;
}
static
scheduler_functions
*
saved_thread_scheduler
;
static
uint
saved_thread_handling
;
...
...
sql/scheduler.h
View file @
8d319b1f
...
...
@@ -72,11 +72,6 @@ enum scheduler_types
void
one_thread_per_connection_scheduler
();
void
one_thread_scheduler
();
enum
pool_command_op
{
NOT_IN_USE_OP
=
0
,
NORMAL_OP
=
1
,
CONNECT_OP
,
KILL_OP
,
DIE_OP
};
/*
To be used for pool-of-threads (implemeneted differently on various OSs)
*/
...
...
@@ -101,6 +96,9 @@ class thd_scheduler
~
thd_scheduler
();
};
void
*
thd_get_scheduler
(
THD
*
thd
);
PSI_thread
*
thd_get_psi
(
THD
*
thd
);
extern
scheduler_functions
*
thread_scheduler
;
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment