v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
v8::JobDelegate Class Referenceabstract

#include <v8-platform.h>

Inheritance diagram for v8::JobDelegate:
Collaboration diagram for v8::JobDelegate:

Public Member Functions

virtual bool ShouldYield ()=0
 
virtual void NotifyConcurrencyIncrease ()=0
 
virtual uint8_t GetTaskId ()=0
 
virtual bool IsJoiningThread () const =0
 

Detailed Description

Delegate that's passed to Job's worker task, providing an entry point to communicate with the scheduler.

Definition at line 206 of file v8-platform.h.

Member Function Documentation

◆ GetTaskId()

virtual uint8_t v8::JobDelegate::GetTaskId ( )
pure virtual

Returns a task_id unique among threads currently running this job, such that GetTaskId() < worker count. To achieve this, the same task_id may be reused by a different thread after a worker_task returns.

Implemented in v8::platform::DefaultJobState::JobDelegate.

Here is the caller graph for this function:

◆ IsJoiningThread()

virtual bool v8::JobDelegate::IsJoiningThread ( ) const
pure virtual

Returns true if the current task is called from the thread currently running JobHandle::Join().

Implemented in v8::platform::DefaultJobState::JobDelegate.

Here is the caller graph for this function:

◆ NotifyConcurrencyIncrease()

virtual void v8::JobDelegate::NotifyConcurrencyIncrease ( )
pure virtual

Notifies the scheduler that max concurrency was increased, and the number of worker should be adjusted accordingly. See Platform::PostJob() for more details.

Implemented in v8::platform::DefaultJobState::JobDelegate.

Here is the caller graph for this function:

◆ ShouldYield()

virtual bool v8::JobDelegate::ShouldYield ( )
pure virtual

Returns true if this thread must return from the worker task on the current thread ASAP. Workers should periodically invoke ShouldYield (or YieldIfNeeded()) as often as is reasonable. After this method returned true, ShouldYield must not be called again.

Implemented in v8::platform::DefaultJobState::JobDelegate.

Here is the caller graph for this function:

The documentation for this class was generated from the following file: