21 #ifndef FXTHREADPOOL_H 22 #define FXTHREADPOOL_H 25 #include "FXRunnable.h" 34 typedef FXLFQueueOf<FXRunnable> FXTaskQueue;
77 volatile FXuint maximum;
78 volatile FXuint minimum;
79 volatile FXuint workers;
80 volatile FXuint running;
98 FXbool
active()
const {
return running==1; }
101 FXbool setSize(FXuint sz);
113 FXbool setMinimumThreads(FXuint n);
119 FXbool setMaximumThreads(FXuint n);
125 FXbool setExpiration(FXTime ns=forever);
131 FXbool setStackSize(FXuval sz);
149 FXuint start(FXuint count=0);
159 FXbool execute(
FXRunnable* task,FXTime blocking=forever);
170 FXbool executeAndWait(
FXRunnable* task,FXTime blocking=forever);
FXuval getStackSize() const
Get stack size.
Definition: FXThreadPool.h:134
FXuint getSize() const
Return task queue size.
Definition: FXThreadPool.h:104
FXuint getRunningThreads() const
Return number of threads.
Definition: FXThreadPool.h:110
A semaphore allows for protection of a resource that can be accessed by a fixed number of simultaneou...
Definition: FXSemaphore.h:38
FXbool active() const
Return true if running.
Definition: FXThreadPool.h:98
FXuint getMaximumThreads() const
Return maximum number of worker threads.
Definition: FXThreadPool.h:122
FXuint getMinimumThreads() const
Return minimum number of worker threads.
Definition: FXThreadPool.h:116
FXuint getSize() const
Return size.
Definition: FXLFQueue.h:50
FXuint getRunningTasks() const
Return number of tasks.
Definition: FXThreadPool.h:107
Definition: FX4Splitter.h:28
FXTime getExpiration() const
Get expiration time.
Definition: FXThreadPool.h:128
A completion counter allows a single thread to monitor a number of ongoing concurrent activities for ...
Definition: FXCompletion.h:41
Automatically generated thread-local storage key.
Definition: FXAutoThreadStorageKey.h:40
FXuint count() const
Return current counter value.
Definition: FXCompletion.h:54
FXRunnable represents a generic runnable thing.
Definition: FXRunnable.h:33
A Thread Pool manages execution of tasks on a number of worker-threads.
Definition: FXThreadPool.h:68