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
fe29dcf9
Commit
fe29dcf9
authored
Dec 22, 2006
by
sunny
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modify que_fork_start_command() to do only one pass over the thread list
instead of three.
parent
a40a569c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
32 deletions
+33
-32
que/que0que.c
que/que0que.c
+33
-32
No files found.
que/que0que.c
View file @
fe29dcf9
...
@@ -335,6 +335,8 @@ que_fork_start_command(
...
@@ -335,6 +335,8 @@ que_fork_start_command(
que_fork_t
*
fork
)
/* in: a query fork */
que_fork_t
*
fork
)
/* in: a query fork */
{
{
que_thr_t
*
thr
;
que_thr_t
*
thr
;
que_thr_t
*
suspended_thr
=
NULL
;
que_thr_t
*
completed_thr
=
NULL
;
fork
->
state
=
QUE_FORK_ACTIVE
;
fork
->
state
=
QUE_FORK_ACTIVE
;
...
@@ -344,14 +346,18 @@ que_fork_start_command(
...
@@ -344,14 +346,18 @@ que_fork_start_command(
but in a parallelized select, which necessarily is non-scrollable,
but in a parallelized select, which necessarily is non-scrollable,
there may be several to choose from */
there may be several to choose from */
/*---------------------------------------------------------------
/* First we try to find a query thread in the QUE_THR_COMMAND_WAIT
First we try to find a query thread in the QUE_THR_COMMAND_WAIT state
state. Then we try to find a query thread in the QUE_THR_SUSPENDED
*/
state, finally we try to find a query thread in the QUE_THR_COMPLETED
state */
thr
=
UT_LIST_GET_FIRST
(
fork
->
thrs
);
thr
=
UT_LIST_GET_FIRST
(
fork
->
thrs
);
while
(
thr
!=
NULL
)
{
/* We make a single pass over the thr list within which we note which
if
(
thr
->
state
==
QUE_THR_COMMAND_WAIT
)
{
threads are ready to run. */
while
(
thr
)
{
switch
(
thr
->
state
)
{
case
QUE_THR_COMMAND_WAIT
:
/* We have to send the initial message to query thread
/* We have to send the initial message to query thread
to start it */
to start it */
...
@@ -359,49 +365,44 @@ que_fork_start_command(
...
@@ -359,49 +365,44 @@ que_fork_start_command(
que_thr_init_command
(
thr
);
que_thr_init_command
(
thr
);
return
(
thr
);
return
(
thr
);
}
ut_ad
(
thr
->
state
!=
QUE_THR_LOCK_WAIT
);
thr
=
UT_LIST_GET_NEXT
(
thrs
,
thr
);
}
/*----------------------------------------------------------------
Then we try to find a query thread in the QUE_THR_SUSPENDED state */
thr
=
UT_LIST_GET_FIRST
(
fork
->
thrs
);
case
QUE_THR_SUSPENDED
:
while
(
thr
!=
NULL
)
{
if
(
thr
->
state
==
QUE_THR_SUSPENDED
)
{
/* In this case the execution of the thread was
/* In this case the execution of the thread was
suspended: no initial message is needed because
suspended: no initial message is needed because
execution can continue from where it was left */
execution can continue from where it was left */
if
(
!
suspended_thr
)
{
suspended_thr
=
thr
;
}
que_thr_move_to_run_state
(
thr
);
break
;
case
QUE_THR_COMPLETED
:
if
(
!
completed_thr
)
{
completed_thr
=
thr
;
}
break
;
case
QUE_THR_LOCK_WAIT
:
ut_error
;
return
(
thr
);
}
}
thr
=
UT_LIST_GET_NEXT
(
thrs
,
thr
);
thr
=
UT_LIST_GET_NEXT
(
thrs
,
thr
);
}
}
/*-----------------------------------------------------------------
if
(
suspended_thr
)
{
Then we try to find a query thread in the QUE_THR_COMPLETED state */
thr
=
UT_LIST_GET_FIRST
(
fork
->
thrs
);
while
(
thr
!=
NULL
)
{
thr
=
suspended_thr
;
if
(
thr
->
state
==
QUE_THR_COMPLETED
)
{
que_thr_move_to_run_state
(
thr
);
que_thr_init_command
(
thr
);
return
(
thr
);
}
else
if
(
completed_thr
)
{
}
thr
=
UT_LIST_GET_NEXT
(
thrs
,
thr
);
thr
=
completed_thr
;
que_thr_init_command
(
thr
);
}
}
/* Else we return NULL */
return
(
thr
);
return
(
NULL
);
}
}
/**************************************************************************
/**************************************************************************
...
...
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