Public Member Functions | Static Public Member Functions | Static Private Member Functions | Private Attributes | List of all members
grpc_core::Executor Class Reference

#include <executor.h>

Public Member Functions

void Enqueue (grpc_closure *closure, grpc_error_handle error, bool is_short)
 
 Executor (const char *executor_name)
 
void Init ()
 
bool IsThreaded () const
 
void SetThreading (bool threading)
 
void Shutdown ()
 

Static Public Member Functions

static void InitAll ()
 
static bool IsThreaded (ExecutorType executor_type)
 
static bool IsThreadedDefault ()
 
static void Run (grpc_closure *closure, grpc_error_handle error, ExecutorType executor_type=ExecutorType::DEFAULT, ExecutorJobType job_type=ExecutorJobType::SHORT)
 
static void SetThreadingAll (bool enable)
 
static void SetThreadingDefault (bool enable)
 
static void ShutdownAll ()
 

Static Private Member Functions

static size_t RunClosures (const char *executor_name, grpc_closure_list list)
 
static void ThreadMain (void *arg)
 

Private Attributes

gpr_spinlock adding_thread_lock_
 
size_t max_threads_
 
const char * name_
 
gpr_atm num_threads_
 
ThreadStatethd_state_
 

Detailed Description

Definition at line 55 of file executor.h.

Constructor & Destructor Documentation

◆ Executor()

grpc_core::Executor::Executor ( const char *  executor_name)
explicit

Definition at line 91 of file executor.cc.

Member Function Documentation

◆ Enqueue()

void grpc_core::Executor::Enqueue ( grpc_closure closure,
grpc_error_handle  error,
bool  is_short 
)

Enqueue the closure onto the executor. is_short is true if the closure is a short job (i.e expected to not block and complete quickly)

Definition at line 260 of file executor.cc.

◆ Init()

void grpc_core::Executor::Init ( )

Definition at line 97 of file executor.cc.

◆ InitAll()

void grpc_core::Executor::InitAll ( )
static

Definition at line 377 of file executor.cc.

◆ IsThreaded() [1/2]

bool grpc_core::Executor::IsThreaded ( ) const

Is the executor multi-threaded?

Definition at line 144 of file executor.cc.

◆ IsThreaded() [2/2]

bool grpc_core::Executor::IsThreaded ( ExecutorType  executor_type)
static

Definition at line 437 of file executor.cc.

◆ IsThreadedDefault()

bool grpc_core::Executor::IsThreadedDefault ( )
static

Definition at line 442 of file executor.cc.

◆ Run()

void grpc_core::Executor::Run ( grpc_closure closure,
grpc_error_handle  error,
ExecutorType  executor_type = ExecutorType::DEFAULT,
ExecutorJobType  job_type = ExecutorJobType::SHORT 
)
static

Definition at line 398 of file executor.cc.

◆ RunClosures()

size_t grpc_core::Executor::RunClosures ( const char *  executor_name,
grpc_closure_list  list 
)
staticprivate

Definition at line 99 of file executor.cc.

◆ SetThreading()

void grpc_core::Executor::SetThreading ( bool  threading)

Definition at line 148 of file executor.cc.

◆ SetThreadingAll()

void grpc_core::Executor::SetThreadingAll ( bool  enable)
static

Definition at line 446 of file executor.cc.

◆ SetThreadingDefault()

void grpc_core::Executor::SetThreadingDefault ( bool  enable)
static

Definition at line 454 of file executor.cc.

◆ Shutdown()

void grpc_core::Executor::Shutdown ( )

Shutdown the executor, running all pending work as part of the call

Definition at line 220 of file executor.cc.

◆ ShutdownAll()

void grpc_core::Executor::ShutdownAll ( )
static

Definition at line 404 of file executor.cc.

◆ ThreadMain()

void grpc_core::Executor::ThreadMain ( void *  arg)
staticprivate

Definition at line 222 of file executor.cc.

Member Data Documentation

◆ adding_thread_lock_

gpr_spinlock grpc_core::Executor::adding_thread_lock_
private

Definition at line 114 of file executor.h.

◆ max_threads_

size_t grpc_core::Executor::max_threads_
private

Definition at line 112 of file executor.h.

◆ name_

const char* grpc_core::Executor::name_
private

Definition at line 110 of file executor.h.

◆ num_threads_

gpr_atm grpc_core::Executor::num_threads_
private

Definition at line 113 of file executor.h.

◆ thd_state_

ThreadState* grpc_core::Executor::thd_state_
private

Definition at line 111 of file executor.h.


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


grpc
Author(s):
autogenerated on Fri May 16 2025 03:03:36