poser
A C framework for POsix SERvices
Loading...
Searching...
No Matches
PSC_ThreadOpts Class Reference

Options for PSC_ThreadPool. More...

#include <poser/core/threadpool.h>

Static Public Member Functions

void PSC_ThreadOpts_init (int defThreads)
 Initialize options with default values.
 
void PSC_ThreadOpts_fixedThreads (int n)
 Set a fixed numer of threads.
 
void PSC_ThreadOpts_threadsPerCpu (int n)
 Set number of threads per CPU.
 
void PSC_ThreadOpts_maxThreads (int n)
 Set maximum number of threads.
 
void PSC_ThreadOpts_fixedQueue (int n)
 Set a fixed queue size for waiting thread jobs.
 
void PSC_ThreadOpts_queuePerThread (int n)
 Set queue size for waiting jobs per thread.
 
void PSC_ThreadOpts_maxQueue (int n)
 Set maximum queue size for waiting thread jobs.
 
void PSC_ThreadOpts_minQueue (int n)
 Set minimum queue size for waiting thread jobs.
 

Detailed Description

Options for PSC_ThreadPool.

This class is for configuring the thread pool. If none of its methods are called, compile-time default values are used.

Member Function Documentation

◆ PSC_ThreadOpts_fixedQueue()

void PSC_ThreadOpts_fixedQueue ( int  n)
static

Set a fixed queue size for waiting thread jobs.

Parameters
nfixed size of the queue

◆ PSC_ThreadOpts_fixedThreads()

void PSC_ThreadOpts_fixedThreads ( int  n)
static

Set a fixed numer of threads.

Parameters
nalways create this many threads

◆ PSC_ThreadOpts_init()

void PSC_ThreadOpts_init ( int  defThreads)
static

Initialize options with default values.

Parameters
defThreadsdefault number of threads to create when number of CPUs can't be determined

◆ PSC_ThreadOpts_maxQueue()

void PSC_ThreadOpts_maxQueue ( int  n)
static

Set maximum queue size for waiting thread jobs.

Parameters
nmaximum size of the queue

◆ PSC_ThreadOpts_maxThreads()

void PSC_ThreadOpts_maxThreads ( int  n)
static

Set maximum number of threads.

Parameters
nnever create more than n threads

◆ PSC_ThreadOpts_minQueue()

void PSC_ThreadOpts_minQueue ( int  n)
static

Set minimum queue size for waiting thread jobs.

Parameters
nminimum size of the queue

◆ PSC_ThreadOpts_queuePerThread()

void PSC_ThreadOpts_queuePerThread ( int  n)
static

Set queue size for waiting jobs per thread.

If no fixed queue size is configured, the queue size will be a multiple of the number of threads created. Default is 2.

Parameters
nqueue size per thread

◆ PSC_ThreadOpts_threadsPerCpu()

void PSC_ThreadOpts_threadsPerCpu ( int  n)
static

Set number of threads per CPU.

If the number of CPUs can be determined and there's no fixed number of threads configured, the number of threads created will be a multiple of the number of CPUs. Default is 1.

Parameters
ncreate n threads per detected CPU

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