ThreadWeaver
WeaverImpl.h
Go to the documentation of this file.
Definition DependencyPolicy.h:32
A Job is a simple abstraction of an action that is to be executed in a thread context.
Definition Job.h:66
We use a State pattern to handle the system state in ThreadWeaver.
Definition State.h:74
The class Thread is used to represent the worker threads in the weaver's inventory.
Definition Thread.h:47
void blockThreadUntilJobsAreBeingAssigned(Thread *th)
Blocks the calling thread until some actor calls assignJobs.
Definition WeaverImpl.cpp:364
void setMaximumNumberOfThreads(int cap)
Set the maximum number of threads this Weaver object may start.
Definition WeaverImpl.cpp:149
void threadStarted(ThreadWeaver::Thread *)
A Thread has been created.
void waitForAvailableJob(Thread *th)
Wait for a job to become available.
Definition WeaverImpl.cpp:359
int maximumNumberOfThreads() const
Get the maximum number of threads this Weaver may start.
Definition WeaverImpl.cpp:156
Job * takeFirstAvailableJob(Job *previous)
Take the first available job out of the queue and return it.
Definition WeaverImpl.cpp:333
void asyncThreadSuspended(ThreadWeaver::Thread *)
virtual Job * applyForWork(Thread *thread, Job *previous)
Assign a job to the calling thread.
Definition WeaverImpl.cpp:354
int currentNumberOfThreads() const
Returns the current number of threads in the inventory.
Definition WeaverImpl.cpp:162
void threadBusy(ThreadWeaver::Thread *, ThreadWeaver::Job *j)
The thread is busy executing job j.
int m_active
The number of jobs that are assigned to the worker threads, but not finished.
Definition WeaverImpl.h:165
void threadSuspended(ThreadWeaver::Thread *)
A thread has been suspended.
void assignJobs()
Schedule enqueued jobs to be executed by idle threads.
Definition WeaverImpl.cpp:288
QWaitCondition m_jobAvailable
Wait condition all idle or done threads wait for.
Definition WeaverImpl.h:169
WeaverInterface(QObject *parent=0)
A ThreadWeaver object manages a queue of Jobs.
Definition WeaverInterface.cpp:33
Observers provides signals on some Weaver events that are otherwise only available through objects of...
Definition WeaverObserver.h:59
Definition DebuggingAids.h:51
StateId
All weaver objects maintain a state of operation which can be queried by the application.
Definition State.h:48
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 17 2025 00:00:00 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 17 2025 00:00:00 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.