libircbot
library providing a framework for implementing an IRC bot
Loading...
Searching...
No Matches
IBThreadOpts Class Reference

A configuration object for the integrated thread pool. More...

#include <ircbot/ircbot.h>

Public Member Functions

void IBThreadOpts_setNThreads (IBThreadOpts *self, int num)
 Set fixed number of threads. More...
 
void IBThreadOpts_setMaxThreads (IBThreadOpts *self, int num)
 Set maximum number of threads. More...
 
void IBThreadOpts_setNPerCpu (IBThreadOpts *self, int num)
 Set number of threads per CPU. More...
 
void IBThreadOpts_setDefNThreads (IBThreadOpts *self, int num)
 Set default number of threads. More...
 
void IBThreadOpts_setQueueLen (IBThreadOpts *self, int num)
 Set a fixed size for the queue of waiting thread jobs. More...
 
void IBThreadOpts_setMaxQueueLen (IBThreadOpts *self, int num)
 Set the maximum size for the queue of waiting thread jobs. More...
 
void IBThreadOpts_setMinQueueLen (IBThreadOpts *self, int num)
 Set the minimum size for the queue of waiting thread jobs. More...
 
void IBThreadOpts_setQLenPerThread (IBThreadOpts *self, int num)
 Set the number of queue entries per thread. More...
 

Detailed Description

A configuration object for the integrated thread pool.

Member Function Documentation

◆ IBThreadOpts_setDefNThreads()

void IBThreadOpts_setDefNThreads ( IBThreadOpts self,
int  num 
)

Set default number of threads.

This is used if no fixed number is given and the number of CPUs can't be determined. Default: 8.

Parameters
selfthe IBThreadOpts
numthe default number of threads

◆ IBThreadOpts_setMaxQueueLen()

void IBThreadOpts_setMaxQueueLen ( IBThreadOpts self,
int  num 
)

Set the maximum size for the queue of waiting thread jobs.

Default: 1024

Parameters
selfthe IBThreadOpts
numthe maximum queue size

◆ IBThreadOpts_setMaxThreads()

void IBThreadOpts_setMaxThreads ( IBThreadOpts self,
int  num 
)

Set maximum number of threads.

If number of threads are derived from the number of CPU, this will be the upper limit to use. Default: 128.

Parameters
selfthe IBThreadOpts
numthe maximum number of threads

◆ IBThreadOpts_setMinQueueLen()

void IBThreadOpts_setMinQueueLen ( IBThreadOpts self,
int  num 
)

Set the minimum size for the queue of waiting thread jobs.

Default: 64

Parameters
selfthe IBThreadOpts
numthe minimum queue size

◆ IBThreadOpts_setNPerCpu()

void IBThreadOpts_setNPerCpu ( IBThreadOpts self,
int  num 
)

Set number of threads per CPU.

Defaults to 2 threads per CPU.

Parameters
selfthe IBThreadOpts
numthe number of threads per CPU

◆ IBThreadOpts_setNThreads()

void IBThreadOpts_setNThreads ( IBThreadOpts self,
int  num 
)

Set fixed number of threads.

If this is given, the thread pool always uses this number of threads. Default: 0 (unset).

Parameters
selfthe IBThreadOpts
numthe numer of threads

◆ IBThreadOpts_setQLenPerThread()

void IBThreadOpts_setQLenPerThread ( IBThreadOpts self,
int  num 
)

Set the number of queue entries per thread.

Default: 2

Parameters
selfthe IBThreadOpts
numthe queue entries per thread

◆ IBThreadOpts_setQueueLen()

void IBThreadOpts_setQueueLen ( IBThreadOpts self,
int  num 
)

Set a fixed size for the queue of waiting thread jobs.

Default: 0 (unset).

Parameters
selfthe IBThreadOpts
numthe queue size

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