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
21326513
Commit
21326513
authored
May 29, 2020
by
Vladislav Vaintroub
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove some trailing whitespaces.
parent
5bf9e0f8
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
205 additions
and
212 deletions
+205
-212
sql/threadpool.h
sql/threadpool.h
+1
-1
sql/threadpool_common.cc
sql/threadpool_common.cc
+11
-11
sql/threadpool_generic.cc
sql/threadpool_generic.cc
+184
-191
sql/threadpool_generic.h
sql/threadpool_generic.h
+1
-1
sql/threadpool_win.cc
sql/threadpool_win.cc
+8
-8
No files found.
sql/threadpool.h
View file @
21326513
...
@@ -138,7 +138,7 @@ struct TP_pool
...
@@ -138,7 +138,7 @@ struct TP_pool
#ifdef _WIN32
#ifdef _WIN32
struct
TP_pool_win
:
TP_pool
struct
TP_pool_win
:
TP_pool
{
{
TP_pool_win
();
TP_pool_win
();
virtual
int
init
();
virtual
int
init
();
virtual
~
TP_pool_win
();
virtual
~
TP_pool_win
();
virtual
TP_connection
*
new_connection
(
CONNECT
*
c
);
virtual
TP_connection
*
new_connection
(
CONNECT
*
c
);
...
...
sql/threadpool_common.cc
View file @
21326513
...
@@ -60,24 +60,24 @@ static inline TP_connection *get_TP_connection(THD *thd)
...
@@ -60,24 +60,24 @@ static inline TP_connection *get_TP_connection(THD *thd)
/*
/*
Worker threads contexts, and THD contexts.
Worker threads contexts, and THD contexts.
=========================================
=========================================
Both worker threads and connections have their sets of thread local variables
Both worker threads and connections have their sets of thread local variables
At the moment it is mysys_var (this has specific data for dbug, my_error and
At the moment it is mysys_var (this has specific data for dbug, my_error and
similar goodies), and PSI per-client structure.
similar goodies), and PSI per-client structure.
Whenever query is executed following needs to be done:
Whenever query is executed following needs to be done:
1. Save worker thread context.
1. Save worker thread context.
2. Change TLS variables to connection specific ones using thread_attach(THD*).
2. Change TLS variables to connection specific ones using thread_attach(THD*).
This function does some additional work , e.g setting up
This function does some additional work , e.g setting up
thread_stack/thread_ends_here pointers.
thread_stack/thread_ends_here pointers.
3. Process query
3. Process query
4. Restore worker thread context.
4. Restore worker thread context.
Connection login and termination follows similar schema w.r.t saving and
Connection login and termination follows similar schema w.r.t saving and
restoring contexts.
restoring contexts.
For both worker thread, and for the connection, mysys variables are created
For both worker thread, and for the connection, mysys variables are created
using my_thread_init() and freed with my_thread_end().
using my_thread_init() and freed with my_thread_end().
*/
*/
...
@@ -154,7 +154,7 @@ static void thread_attach(THD* thd)
...
@@ -154,7 +154,7 @@ static void thread_attach(THD* thd)
}
}
/*
/*
Determine connection priority , using current
Determine connection priority , using current
transaction state and 'threadpool_priority' variable value.
transaction state and 'threadpool_priority' variable value.
*/
*/
static
TP_PRIORITY
get_priority
(
TP_connection
*
c
)
static
TP_PRIORITY
get_priority
(
TP_connection
*
c
)
...
@@ -289,7 +289,7 @@ static void threadpool_remove_connection(THD *thd)
...
@@ -289,7 +289,7 @@ static void threadpool_remove_connection(THD *thd)
delete
thd
;
delete
thd
;
/*
/*
Free resources associated with this connection:
Free resources associated with this connection:
mysys thread_var and PSI thread.
mysys thread_var and PSI thread.
*/
*/
my_thread_end
();
my_thread_end
();
...
@@ -323,8 +323,8 @@ static int threadpool_process_request(THD *thd)
...
@@ -323,8 +323,8 @@ static int threadpool_process_request(THD *thd)
if
(
thd
->
killed
>=
KILL_CONNECTION
)
if
(
thd
->
killed
>=
KILL_CONNECTION
)
{
{
/*
/*
killed flag was set by timeout handler
killed flag was set by timeout handler
or KILL command. Return error.
or KILL command. Return error.
*/
*/
retval
=
1
;
retval
=
1
;
...
...
sql/threadpool_generic.cc
View file @
21326513
This diff is collapsed.
Click to expand it.
sql/threadpool_generic.h
View file @
21326513
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
#ifdef _WIN32
#ifdef _WIN32
#include <windows.h>
#include <windows.h>
/* AIX may define this, too ?*/
/* AIX may define this, too ?*/
#define HAVE_IOCP
#define HAVE_IOCP
#endif
#endif
...
...
sql/threadpool_win.cc
View file @
21326513
...
@@ -59,10 +59,10 @@ PTP_CALLBACK_ENVIRON get_threadpool_win_callback_environ()
...
@@ -59,10 +59,10 @@ PTP_CALLBACK_ENVIRON get_threadpool_win_callback_environ()
*/
*/
static
void
CALLBACK
timer_callback
(
PTP_CALLBACK_INSTANCE
instance
,
static
void
CALLBACK
timer_callback
(
PTP_CALLBACK_INSTANCE
instance
,
PVOID
context
,
PTP_TIMER
timer
);
PVOID
context
,
PTP_TIMER
timer
);
static
void
CALLBACK
io_completion_callback
(
PTP_CALLBACK_INSTANCE
instance
,
static
void
CALLBACK
io_completion_callback
(
PTP_CALLBACK_INSTANCE
instance
,
PVOID
context
,
PVOID
overlapped
,
ULONG
io_result
,
ULONG_PTR
nbytes
,
PTP_IO
io
);
PVOID
context
,
PVOID
overlapped
,
ULONG
io_result
,
ULONG_PTR
nbytes
,
PTP_IO
io
);
...
@@ -128,7 +128,7 @@ void TP_pool_win::add(TP_connection *c)
...
@@ -128,7 +128,7 @@ void TP_pool_win::add(TP_connection *c)
TP_connection_win
::
TP_connection_win
(
CONNECT
*
c
)
:
TP_connection_win
::
TP_connection_win
(
CONNECT
*
c
)
:
TP_connection
(
c
),
TP_connection
(
c
),
timeout
(
ULONGLONG_MAX
),
timeout
(
ULONGLONG_MAX
),
callback_instance
(
0
),
callback_instance
(
0
),
io
(
0
),
io
(
0
),
timer
(
0
),
timer
(
0
),
...
@@ -218,14 +218,14 @@ int TP_connection_win::start_io()
...
@@ -218,14 +218,14 @@ int TP_connection_win::start_io()
if
(
retval
==
0
||
last_error
==
ERROR_MORE_DATA
)
if
(
retval
==
0
||
last_error
==
ERROR_MORE_DATA
)
{
{
/*
/*
IO successfully finished (synchronously).
IO successfully finished (synchronously).
If skip_completion_port_on_success is set, we need to handle it right
If skip_completion_port_on_success is set, we need to handle it right
here, because completion callback would not be executed by the pool.
here, because completion callback would not be executed by the pool.
*/
*/
if
(
skip_completion_port_on_success
)
if
(
skip_completion_port_on_success
)
{
{
CancelThreadpoolIo
(
io
);
CancelThreadpoolIo
(
io
);
io_completion_callback
(
callback_instance
,
this
,
&
overlapped
,
last_error
,
io_completion_callback
(
callback_instance
,
this
,
&
overlapped
,
last_error
,
num_bytes
,
io
);
num_bytes
,
io
);
}
}
return
0
;
return
0
;
...
@@ -322,7 +322,7 @@ static void pre_callback(PVOID context, PTP_CALLBACK_INSTANCE instance)
...
@@ -322,7 +322,7 @@ static void pre_callback(PVOID context, PTP_CALLBACK_INSTANCE instance)
/*
/*
Decrement number of threads when a thread exits
.
Decrement number of threads when a thread exits
.
On Windows, FlsAlloc() provides the thread destruction callbacks.
On Windows, FlsAlloc() provides the thread destruction callbacks.
*/
*/
static
VOID
WINAPI
thread_destructor
(
void
*
data
)
static
VOID
WINAPI
thread_destructor
(
void
*
data
)
...
@@ -346,7 +346,7 @@ static inline void tp_callback(PTP_CALLBACK_INSTANCE instance, PVOID context)
...
@@ -346,7 +346,7 @@ static inline void tp_callback(PTP_CALLBACK_INSTANCE instance, PVOID context)
/*
/*
Handle read completion/notification.
Handle read completion/notification.
*/
*/
static
VOID
CALLBACK
io_completion_callback
(
PTP_CALLBACK_INSTANCE
instance
,
static
VOID
CALLBACK
io_completion_callback
(
PTP_CALLBACK_INSTANCE
instance
,
PVOID
context
,
PVOID
overlapped
,
ULONG
io_result
,
ULONG_PTR
nbytes
,
PTP_IO
io
)
PVOID
context
,
PVOID
overlapped
,
ULONG
io_result
,
ULONG_PTR
nbytes
,
PTP_IO
io
)
{
{
TP_connection_win
*
c
=
(
TP_connection_win
*
)
context
;
TP_connection_win
*
c
=
(
TP_connection_win
*
)
context
;
...
...
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