JUCE v8.0.9
JUCE API
 
Loading...
Searching...
No Matches
juce::ThreadPoolOptions Struct Reference

A set of threads that will run a list of jobs. More...

#include <juce_ThreadPool.h>

Collaboration diagram for juce::ThreadPoolOptions:

Public Member Functions

ThreadPoolOptions withDesiredThreadPriority (Thread::Priority newDesiredThreadPriority) const
 The desired priority of each thread in the pool.
 
ThreadPoolOptions withNumberOfThreads (int newNumberOfThreads) const
 The number of threads to run.
 
ThreadPoolOptions withThreadName (String newThreadName) const
 The name to give each thread in the pool.
 
ThreadPoolOptions withThreadStackSizeBytes (size_t newThreadStackSizeBytes) const
 The size of the stack of each thread in the pool.
 

Public Attributes

Thread::Priority desiredThreadPriority { Thread::Priority::normal }
 
int numberOfThreads { SystemStats::getNumCpus() }
 
String threadName { "Pool" }
 
size_t threadStackSizeBytes { Thread::osDefaultStackSize }
 

Detailed Description

A set of threads that will run a list of jobs.

When a ThreadPoolJob object is added to the ThreadPool's list, its runJob() method will be called by the next pooled thread that becomes free.

See also
ThreadPoolJob, Thread

@tags{Core}

Member Function Documentation

◆ withDesiredThreadPriority()

ThreadPoolOptions juce::ThreadPoolOptions::withDesiredThreadPriority ( Thread::Priority  newDesiredThreadPriority) const
inline

The desired priority of each thread in the pool.

References desiredThreadPriority, and juce::withMember().

◆ withNumberOfThreads()

ThreadPoolOptions juce::ThreadPoolOptions::withNumberOfThreads ( int  newNumberOfThreads) const
inline

The number of threads to run.

These will be started when a pool is created, and run until the pool is destroyed.

References numberOfThreads, and juce::withMember().

◆ withThreadName()

ThreadPoolOptions juce::ThreadPoolOptions::withThreadName ( String  newThreadName) const
inline

The name to give each thread in the pool.

References threadName, and juce::withMember().

◆ withThreadStackSizeBytes()

ThreadPoolOptions juce::ThreadPoolOptions::withThreadStackSizeBytes ( size_t  newThreadStackSizeBytes) const
inline

The size of the stack of each thread in the pool.

References threadStackSizeBytes, and juce::withMember().

Member Data Documentation

◆ desiredThreadPriority

Thread::Priority juce::ThreadPoolOptions::desiredThreadPriority { Thread::Priority::normal }

◆ numberOfThreads

int juce::ThreadPoolOptions::numberOfThreads { SystemStats::getNumCpus() }

Referenced by withNumberOfThreads().

◆ threadName

String juce::ThreadPoolOptions::threadName { "Pool" }

Referenced by withThreadName().

◆ threadStackSizeBytes

size_t juce::ThreadPoolOptions::threadStackSizeBytes { Thread::osDefaultStackSize }

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