Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cancel #36740

Merged
merged 24 commits into from
Oct 28, 2021
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
8744ba7
add align for WorkQueue
liutiexing Sep 22, 2021
4759bc8
Merge branch 'develop' of /~https://github.com/liutiexing/Paddle into d…
liutiexing Sep 22, 2021
6f00ace
add spinlock
liutiexing Sep 23, 2021
2d6f1cf
merge develop
liutiexing Sep 23, 2021
f5099be
Merge branch 'develop' of /~https://github.com/liutiexing/Paddle into d…
liutiexing Sep 26, 2021
54aa332
merge develop
liutiexing Oct 12, 2021
1d1bd82
merge
liutiexing Oct 12, 2021
dfbf3e4
Merge remote-tracking branch 'upstream/develop' into develop
liutiexing Oct 12, 2021
a5392b3
Merge remote-tracking branch 'upstream/develop' into develop
liutiexing Oct 14, 2021
45422f8
Add EventsWaiter
liutiexing Oct 15, 2021
c446655
update
liutiexing Oct 15, 2021
c145502
Merge remote-tracking branch 'upstream/develop' into EventsWaiter
liutiexing Oct 15, 2021
46f4baa
update
liutiexing Oct 16, 2021
bf8c171
Merge remote-tracking branch 'upstream/develop' into EventsWaiter
liutiexing Oct 16, 2021
843844f
update Error MSG
liutiexing Oct 16, 2021
bf88cd7
Merge remote-tracking branch 'upstream/develop' into EventsWaiter
liutiexing Oct 21, 2021
1c2e10d
update EventsWaiter
liutiexing Oct 21, 2021
0e6623d
Add Cancel For ThreadPool
liutiexing Oct 24, 2021
3246a77
merge upstream
liutiexing Oct 25, 2021
d5ceea3
Add UT for Cancel
liutiexing Oct 25, 2021
bf97000
Merge remote-tracking branch 'upstream/develop' into FixCancel
liutiexing Oct 26, 2021
9048f58
fix Cancel
liutiexing Oct 26, 2021
993363f
Merge remote-tracking branch 'upstream/develop' into FixCancel
liutiexing Oct 26, 2021
482c437
Merge branch 'PaddlePaddle:develop' into FixCancel
liutiexing Oct 27, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions paddle/fluid/framework/new_executor/nonblocking_threadpool.h
Original file line number Diff line number Diff line change
Expand Up @@ -394,16 +394,16 @@ class ThreadPoolTempl {
// We already did best-effort emptiness check in Steal, so prepare for
// blocking.
ec_.Prewait();
if (cancelled_) {
ec_.CancelWait();
return false;
}
// Now do a reliable emptiness check.
int victim = NonEmptyQueueIndex();
if (victim != -1) {
ec_.CancelWait();
if (cancelled_) {
return false;
} else {
*t = thread_data_[victim].queue.PopBack();
return true;
}
*t = thread_data_[victim].queue.PopBack();
return true;
}
// Number of blocked threads is used as termination condition.
// If we are shutting down and all worker threads blocked without work,
Expand Down