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

#include <threadpool.h>

Inheritance diagram for grpc_core::ThreadPool:
Inheritance graph
[legend]

Public Member Functions

void Add (grpc_completion_queue_functor *closure) override
 
int num_pending_closures () const override
 
int pool_capacity () const override
 
const char * thread_name () const override
 
const Thread::Optionsthread_options () const override
 
 ThreadPool (int num_threads)
 
 ThreadPool (int num_threads, const char *thd_name)
 
 ThreadPool (int num_threads, const char *thd_name, const Thread::Options &thread_options)
 
 ~ThreadPool () override
 
- Public Member Functions inherited from grpc_core::ThreadPoolInterface
virtual ~ThreadPoolInterface ()
 

Private Member Functions

void AssertHasNotBeenShutDown ()
 
size_t DefaultStackSize ()
 
void SharedThreadPoolConstructor ()
 

Private Attributes

int num_threads_ = 0
 
MPMCQueueInterfacequeue_ = nullptr
 
std::atomic< boolshut_down_
 
const char * thd_name_ = nullptr
 
Thread::Options thread_options_
 
ThreadPoolWorker ** threads_ = nullptr
 

Detailed Description

Definition at line 97 of file src/core/lib/iomgr/executor/threadpool.h.

Constructor & Destructor Documentation

◆ ThreadPool() [1/3]

grpc_core::ThreadPool::ThreadPool ( int  num_threads)
explicit

Definition at line 78 of file threadpool.cc.

◆ ThreadPool() [2/3]

grpc_core::ThreadPool::ThreadPool ( int  num_threads,
const char *  thd_name 
)

Definition at line 85 of file threadpool.cc.

◆ ThreadPool() [3/3]

grpc_core::ThreadPool::ThreadPool ( int  num_threads,
const char *  thd_name,
const Thread::Options thread_options 
)

Definition at line 92 of file threadpool.cc.

◆ ~ThreadPool()

grpc_core::ThreadPool::~ThreadPool ( )
override

Definition at line 103 of file threadpool.cc.

Member Function Documentation

◆ Add()

void grpc_core::ThreadPool::Add ( grpc_completion_queue_functor closure)
overridevirtual

Implements grpc_core::ThreadPoolInterface.

Definition at line 122 of file threadpool.cc.

◆ AssertHasNotBeenShutDown()

void grpc_core::ThreadPool::AssertHasNotBeenShutDown ( )
private

Definition at line 73 of file threadpool.cc.

◆ DefaultStackSize()

size_t grpc_core::ThreadPool::DefaultStackSize ( )
private

Definition at line 65 of file threadpool.cc.

◆ num_pending_closures()

int grpc_core::ThreadPool::num_pending_closures ( ) const
overridevirtual

Implements grpc_core::ThreadPoolInterface.

Definition at line 127 of file threadpool.cc.

◆ pool_capacity()

int grpc_core::ThreadPool::pool_capacity ( ) const
overridevirtual

Implements grpc_core::ThreadPoolInterface.

Definition at line 129 of file threadpool.cc.

◆ SharedThreadPoolConstructor()

void grpc_core::ThreadPool::SharedThreadPoolConstructor ( )
private

Definition at line 49 of file threadpool.cc.

◆ thread_name()

const char * grpc_core::ThreadPool::thread_name ( ) const
overridevirtual

Implements grpc_core::ThreadPoolInterface.

Definition at line 135 of file threadpool.cc.

◆ thread_options()

const Thread::Options & grpc_core::ThreadPool::thread_options ( ) const
overridevirtual

Implements grpc_core::ThreadPoolInterface.

Definition at line 131 of file threadpool.cc.

Member Data Documentation

◆ num_threads_

int grpc_core::ThreadPool::num_threads_ = 0
private

Definition at line 131 of file src/core/lib/iomgr/executor/threadpool.h.

◆ queue_

MPMCQueueInterface* grpc_core::ThreadPool::queue_ = nullptr
private

Definition at line 135 of file src/core/lib/iomgr/executor/threadpool.h.

◆ shut_down_

std::atomic<bool> grpc_core::ThreadPool::shut_down_
private
Initial value:
{
false}

Definition at line 137 of file src/core/lib/iomgr/executor/threadpool.h.

◆ thd_name_

const char* grpc_core::ThreadPool::thd_name_ = nullptr
private

Definition at line 132 of file src/core/lib/iomgr/executor/threadpool.h.

◆ thread_options_

Thread::Options grpc_core::ThreadPool::thread_options_
private

Definition at line 133 of file src/core/lib/iomgr/executor/threadpool.h.

◆ threads_

ThreadPoolWorker** grpc_core::ThreadPool::threads_ = nullptr
private

Definition at line 134 of file src/core/lib/iomgr/executor/threadpool.h.


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


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