ThreadWeaver
WeaverImpl.h
Go to the documentation of this file.
void setMaximumNumberOfThreads(int cap)
Set the maximum number of threads this Weaver object may start.
Definition: WeaverImpl.cpp:149
int m_active
The number of jobs that are assigned to the worker threads, but not finished.
Definition: WeaverImpl.h:165
void asyncThreadSuspended(ThreadWeaver::Thread *)
The class Thread is used to represent the worker threads in the weaver's inventory.
Definition: Thread.h:46
QThread * thread() const
StateId
All weaver objects maintain a state of operation which can be queried by the application.
Definition: State.h:48
Job * takeFirstAvailableJob(Job *previous)
Take the first available job out of the queue and return it.
Definition: WeaverImpl.cpp:333
void assignJobs()
Schedule enqueued jobs to be executed by idle threads.
Definition: WeaverImpl.cpp:288
int currentNumberOfThreads() const
Returns the current number of threads in the inventory.
Definition: WeaverImpl.cpp:162
Definition: DependencyPolicy.h:32
void threadStarted(ThreadWeaver::Thread *)
A Thread has been created.
void threadBusy(ThreadWeaver::Thread *, ThreadWeaver::Job *j)
The thread is busy executing job j.
We use a State pattern to handle the system state in ThreadWeaver.
Definition: State.h:73
virtual Job * applyForWork(Thread *thread, Job *previous)
Assign a job to the calling thread.
Definition: WeaverImpl.cpp:354
WeaverInterface provides a common interface for weaver implementations.
Definition: WeaverInterface.h:61
void threadSuspended(ThreadWeaver::Thread *)
A thread has been suspended.
A Job is a simple abstraction of an action that is to be executed in a thread context.
Definition: Job.h:65
Observers provides signals on some Weaver events that are otherwise only available through objects of...
Definition: WeaverObserver.h:58
void waitForAvailableJob(Thread *th)
Wait for a job to become available.
Definition: WeaverImpl.cpp:359
void blockThreadUntilJobsAreBeingAssigned(Thread *th)
Blocks the calling thread until some actor calls assignJobs.
Definition: WeaverImpl.cpp:364
QObject * parent() const
bool isEmpty() const
Is the queue empty? The queue is empty if no more jobs are queued.
Definition: WeaverImpl.cpp:293
A WeaverImpl is the manager of worker threads (Thread objects) to which it assigns jobs from its queu...
Definition: WeaverImpl.h:51
int maximumNumberOfThreads() const
Get the maximum number of threads this Weaver may start.
Definition: WeaverImpl.cpp:156
bool isIdle() const
Is the weaver idle? The weaver is idle if no jobs are queued and no jobs are processed by the threads...
Definition: WeaverImpl.cpp:380
QWaitCondition m_jobAvailable
Wait condition all idle or done threads wait for.
Definition: WeaverImpl.h:169
Not a state, but a sentinel for the number of defined states.
Definition: State.h:68
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:23:33 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:23:33 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.