Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(323)

Unified Diff: include/v8-platform.h

Issue 1664203004: [platform] Add NumberOfAvailableBackgroundThreads (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comment Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/libplatform/default-platform.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/v8-platform.h
diff --git a/include/v8-platform.h b/include/v8-platform.h
index 4fbef0f5d96bb49ce6a473d715145f614023224a..11f8d51f02573e1f3ea32a2efba21635ffa25e6d 100644
--- a/include/v8-platform.h
+++ b/include/v8-platform.h
@@ -5,6 +5,7 @@
#ifndef V8_V8_PLATFORM_H_
#define V8_V8_PLATFORM_H_
+#include <stddef.h>
#include <stdint.h>
namespace v8 {
@@ -56,6 +57,15 @@ class Platform {
virtual ~Platform() {}
/**
+ * Gets the number of threads that are used to execute background tasks. Is
+ * used to estimate the number of tasks a work package should be split into.
+ * A return value of 0 means that there are no background threads available.
+ * Note that a value of 0 won't prohibit V8 from posting tasks using
+ * |CallOnBackgroundThread|.
+ */
+ virtual size_t NumberOfAvailableBackgroundThreads() { return 0; }
+
+ /**
* Schedules a task to be invoked on a background thread. |expected_runtime|
* indicates that the task will run a long time. The Platform implementation
* takes ownership of |task|. There is no guarantee about order of execution
« no previous file with comments | « no previous file | src/libplatform/default-platform.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698