ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
POCKETFFT_NAMESPACE::detail::threading::thread_pool Class Reference

#include <pocketfft_hdronly.h>

Detailed Description

Definition at line 807 of file pocketfft_hdronly.h.

+ Collaboration diagram for POCKETFFT_NAMESPACE::detail::threading::thread_pool:

Classes

struct  worker
 

Public Member Functions

void restart ()
 
void shutdown ()
 
void submit (std::function< void()> work)
 
 thread_pool ()
 
 thread_pool (vcl_size_t nthreads)
 
 ~thread_pool ()
 

Private Types

using lock_t = std::lock_guard<std::mutex>
 

Private Member Functions

void create_threads ()
 
void shutdown_locked ()
 

Private Attributes

std::mutex mut_
 
concurrent_queue< std::function< void()> > overflow_work_
 
std::atomic< bool > shutdown_
 
std::atomic< vcl_size_t > unscheduled_tasks_
 
std::vector< worker, aligned_allocator< worker > > workers_
 

Static Private Attributes

static constexpr vcl_size_t cache_line_size = 64
 

Member Typedef Documentation

◆ lock_t

using POCKETFFT_NAMESPACE::detail::threading::thread_pool::lock_t = std::lock_guard<std::mutex>
private

Definition at line 871 of file pocketfft_hdronly.h.

Constructor & Destructor Documentation

◆ thread_pool() [1/2]

POCKETFFT_NAMESPACE::detail::threading::thread_pool::thread_pool ( vcl_size_t nthreads)
inlineexplicit

Definition at line 909 of file pocketfft_hdronly.h.

References create_threads(), and workers_.

Referenced by thread_pool().

◆ thread_pool() [2/2]

POCKETFFT_NAMESPACE::detail::threading::thread_pool::thread_pool ( )
inline

◆ ~thread_pool()

POCKETFFT_NAMESPACE::detail::threading::thread_pool::~thread_pool ( )
inline

Definition at line 915 of file pocketfft_hdronly.h.

References shutdown().

Member Function Documentation

◆ create_threads()

void POCKETFFT_NAMESPACE::detail::threading::thread_pool::create_threads ( )
inlineprivate

Definition at line 873 of file pocketfft_hdronly.h.

References mut_, overflow_work_, shutdown_, shutdown_locked(), unscheduled_tasks_, and workers_.

Referenced by restart(), and thread_pool().

◆ restart()

void POCKETFFT_NAMESPACE::detail::threading::thread_pool::restart ( )
inline

Definition at line 948 of file pocketfft_hdronly.h.

References create_threads(), and shutdown_.

◆ shutdown()

void POCKETFFT_NAMESPACE::detail::threading::thread_pool::shutdown ( )
inline

Definition at line 942 of file pocketfft_hdronly.h.

References mut_, and shutdown_locked().

Referenced by ~thread_pool().

◆ shutdown_locked()

void POCKETFFT_NAMESPACE::detail::threading::thread_pool::shutdown_locked ( )
inlineprivate

Definition at line 897 of file pocketfft_hdronly.h.

References shutdown_, and workers_.

Referenced by create_threads(), and shutdown().

◆ submit()

void POCKETFFT_NAMESPACE::detail::threading::thread_pool::submit ( std::function< void()> work)
inline

Definition at line 917 of file pocketfft_hdronly.h.

References mut_, overflow_work_, shutdown_, unscheduled_tasks_, and workers_.

Member Data Documentation

◆ cache_line_size

vcl_size_t POCKETFFT_NAMESPACE::detail::threading::thread_pool::cache_line_size = 64
staticconstexprprivate

Definition at line 810 of file pocketfft_hdronly.h.

◆ mut_

std::mutex POCKETFFT_NAMESPACE::detail::threading::thread_pool::mut_
private

Definition at line 867 of file pocketfft_hdronly.h.

Referenced by create_threads(), shutdown(), and submit().

◆ overflow_work_

concurrent_queue<std::function<void()> > POCKETFFT_NAMESPACE::detail::threading::thread_pool::overflow_work_
private

Definition at line 866 of file pocketfft_hdronly.h.

Referenced by create_threads(), and submit().

◆ shutdown_

std::atomic<bool> POCKETFFT_NAMESPACE::detail::threading::thread_pool::shutdown_
private

Definition at line 869 of file pocketfft_hdronly.h.

Referenced by create_threads(), restart(), shutdown_locked(), and submit().

◆ unscheduled_tasks_

std::atomic<vcl_size_t> POCKETFFT_NAMESPACE::detail::threading::thread_pool::unscheduled_tasks_
private

Definition at line 870 of file pocketfft_hdronly.h.

Referenced by create_threads(), and submit().

◆ workers_

std::vector<worker, aligned_allocator<worker> > POCKETFFT_NAMESPACE::detail::threading::thread_pool::workers_
private

Definition at line 868 of file pocketfft_hdronly.h.

Referenced by create_threads(), shutdown_locked(), submit(), and thread_pool().


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