Skip to content

Add Task::yieldIfDue#4620

Closed
oerling wants to merge 1 commit intofacebookincubator:mainfrom
oerling:yield-pr
Closed

Add Task::yieldIfDue#4620
oerling wants to merge 1 commit intofacebookincubator:mainfrom
oerling:yield-pr

Conversation

@oerling
Copy link
Contributor

@oerling oerling commented Apr 14, 2023

Adds a function to get a Task off thread after a minimum slice of running time.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Apr 14, 2023
@netlify
Copy link

netlify bot commented Apr 14, 2023

Deploy Preview for meta-velox canceled.

Name Link
🔨 Latest commit 9f1338d
🔍 Latest deploy log https://app.netlify.com/sites/meta-velox/deploys/6439b0cac3edae0008bd9185

@facebook-github-bot
Copy link
Contributor

@oerling has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

Copy link
Contributor

@xiaoxmeng xiaoxmeng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@oerling thanks for the change & some nits.

std::shared_ptr<BlockingState>& blockingState,
RowVectorPtr& result) {
auto queuedTime = (getCurrentTimeMicro() - queueTimeStartMicros_) * 1'000;
auto now = getCurrentTimeMicro();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:

const auto now
const auto queuedTime
const auto stop


int32_t Task::yieldIfDue(uint64_t startTimeMicros) {
if (onThreadSince_ < startTimeMicros) {
std::lock_guard<std::mutex> xx(mutex_);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/xx/l/

Adds a function to get a Task off thread after a minimum slice of
running time.
@facebook-github-bot
Copy link
Contributor

@oerling has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@oerling merged this pull request in 9d909c9.

usurai pushed a commit to usurai/velox that referenced this pull request Apr 18, 2023
Summary:
Adds a function to get a Task off thread after a minimum slice of running time.

Pull Request resolved: facebookincubator#4620

Reviewed By: xiaoxmeng

Differential Revision: D45007832

Pulled By: oerling

fbshipit-source-id: 0c36274ccce83e05c35dd2606999edeb6cbbcdf1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants