Grok 12.0.1
Public Member Functions | Static Public Member Functions | Static Private Member Functions | Private Attributes | List of all members
hwy::ThreadPool Class Reference

#include <thread_pool.h>

Public Member Functions

 ThreadPool (size_t num_threads)
 
 ~ThreadPool ()
 
 ThreadPool (const ThreadPool &)=delete
 
ThreadPooloperator& (const ThreadPool &)=delete
 
size_t NumWorkers () const
 
void SetWaitMode (PoolWaitMode mode)
 
template<class Closure >
void Run (uint64_t begin, uint64_t end, const Closure &closure)
 
size_t NumThreads () const
 
template<class InitClosure , class RunClosure >
bool Run (uint64_t begin, uint64_t end, const InitClosure &init_closure, const RunClosure &run_closure)
 
PoolMemInternalMem () const
 

Static Public Member Functions

static size_t MaxThreads ()
 
static bool NoInit (size_t)
 

Static Private Member Functions

static void ThreadFunc (size_t thread, size_t num_workers, PoolMem *mem)
 

Private Attributes

std::vector< std::thread > threads_
 
PoolMemOwner owner_
 
std::atomic< int > busy_ {0}
 

Constructor & Destructor Documentation

◆ ThreadPool() [1/2]

hwy::ThreadPool::ThreadPool ( size_t num_threads)
inlineexplicit

◆ ~ThreadPool()

hwy::ThreadPool::~ThreadPool ( )
inline

◆ ThreadPool() [2/2]

hwy::ThreadPool::ThreadPool ( const ThreadPool & )
delete

Member Function Documentation

◆ InternalMem()

PoolMem & hwy::ThreadPool::InternalMem ( ) const
inline

◆ MaxThreads()

static size_t hwy::ThreadPool::MaxThreads ( )
inlinestatic

◆ NoInit()

static bool hwy::ThreadPool::NoInit ( size_t )
inlinestatic

◆ NumThreads()

size_t hwy::ThreadPool::NumThreads ( ) const
inline

◆ NumWorkers()

size_t hwy::ThreadPool::NumWorkers ( ) const
inline

◆ operator&()

ThreadPool & hwy::ThreadPool::operator& ( const ThreadPool & )
delete

◆ Run() [1/2]

template<class Closure >
void hwy::ThreadPool::Run ( uint64_t begin,
uint64_t end,
const Closure & closure )
inline

◆ Run() [2/2]

template<class InitClosure , class RunClosure >
bool hwy::ThreadPool::Run ( uint64_t begin,
uint64_t end,
const InitClosure & init_closure,
const RunClosure & run_closure )
inline

◆ SetWaitMode()

void hwy::ThreadPool::SetWaitMode ( PoolWaitMode mode)
inline

◆ ThreadFunc()

static void hwy::ThreadPool::ThreadFunc ( size_t thread,
size_t num_workers,
PoolMem * mem )
inlinestaticprivate

Member Data Documentation

◆ busy_

std::atomic<int> hwy::ThreadPool::busy_ {0}
private

◆ owner_

PoolMemOwner hwy::ThreadPool::owner_
private

◆ threads_

std::vector<std::thread> hwy::ThreadPool::threads_
private

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