Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
StackExchange.Redis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tsai
StackExchange.Redis
Commits
ba0229ef
Commit
ba0229ef
authored
Apr 24, 2015
by
Marc Gravell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
The incremental wait loop turns out not to have been particularly useful
parent
af02be00
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
22 deletions
+0
-22
ConnectionMultiplexer.cs
...change.Redis/StackExchange/Redis/ConnectionMultiplexer.cs
+0
-22
No files found.
StackExchange.Redis/StackExchange/Redis/ConnectionMultiplexer.cs
View file @
ba0229ef
...
...
@@ -594,29 +594,7 @@ private async Task<bool> WaitAllIgnoreErrorsAsync(Task[] tasks, int timeoutMilli
return
true
;
}
// try and allow them to finish without needing to await; re-acquiring the thread can be massively problematic
int
delay
=
1
;
LogLockedWithThreadPoolStats
(
log
,
"Incremental wait loop for tasks"
);
var
watch
=
Stopwatch
.
StartNew
();
for
(
int
i
=
0
;
i
<
10
;
i
++)
{
var
remaining
=
timeoutMilliseconds
-
checked
((
int
)
watch
.
ElapsedMilliseconds
);
if
(
remaining
<=
0
)
{
LogLockedWithThreadPoolStats
(
log
,
"Timeout waiting for tasks"
);
return
false
;
}
if
(
delay
>
remaining
)
delay
=
remaining
;
Thread
.
Sleep
(
delay
);
if
(
AllComplete
(
tasks
))
{
LogLockedWithThreadPoolStats
(
log
,
"Tasks completed in sleep-loop"
);
return
true
;
}
delay
=
(
delay
*
3
)
>>
1
;
if
(
delay
==
1
)
delay
=
2
;
}
LogLockedWithThreadPoolStats
(
log
,
"Awaiting task completion"
);
...
...
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