Commit 75a78092 authored by Andreas Haas's avatar Andreas Haas Committed by Commit Bot

[v8][api] Add API function CallLowPriorityTaskOnWorkerThread

When we run TurboFan compilation for WebAssembly on worker threads with
default priority, we see in bug reports (https://crbug.com/914757) and
in experiments that TurboFan compilation can block other, higher
priority tasks. Therefore we want to post TurboFan compilation tasks
with lower priority.

A quick prototype showed that if we run all WebAssembly compilation with
low priority, the problem described in https://crbug.com/914757 is
fixed.

R=adamk@chromium.org
CC=rmcilroy@chromium.org

Bug: chromium:920181
Change-Id: I85e2c0c6a96ff9ef165a23ef8eb531944b20f2b0
Reviewed-on: https://chromium-review.googlesource.com/c/1402790Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58792}
parent f726d7f0
......@@ -331,6 +331,15 @@ class Platform {
CallOnWorkerThread(std::move(task));
}
/**
* Schedules a task to be invoked with low-priority on a worker thread.
*/
virtual void CallLowPriorityTaskOnWorkerThread(std::unique_ptr<Task> task) {
// Embedders may optionally override this to process these tasks in a low
// priority pool.
CallOnWorkerThread(std::move(task));
}
/**
* Schedules a task to be invoked on a worker thread after |delay_in_seconds|
* expires.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment