ThreadWeaver
resourcerestrictionpolicy.h
23/** @brief ResourceRestrictionPolicy is used to limit the number of concurrent accesses to the same resource.
25 * If a set of Jobs accesses a resource that can be overloaded, this may degrade application performance. For
26 * example, loading too many files from the hard disc at the same time may lead to longer load times.
27 * ResourceRestrictionPolicy can be used to cap the number of accesses. Resource restriction policies are
28 * shared between the affected jobs. All jobs that share a resource restriction policy have to acquire
29 * permission from the policy before they can run. In this way, resource restrictions can be compared to
31 * The example uses a resource restriction to limit the number of images files that are loaded from
42 * Capping the amount of jobs will make sure that at max the number of jobs executing at any time is
QueuePolicy is an interface for customizations of the queueing behaviour of jobs.
Definition queuepolicy.h:39
void release(JobPointer) override
release() is called if canRun() returned true, but the job has not been executed for external reasons...
Definition resourcerestrictionpolicy.cpp:84
bool canRun(JobPointer) override
canRun() is called before the job is executed.
Definition resourcerestrictionpolicy.cpp:61
void destructed(JobInterface *job) override
destructing() is called when a Job that has this queue policy assigned gets destructed.
Definition resourcerestrictionpolicy.cpp:89
void setCap(int newCap)
Cap the number of simultaneously executing jobs.
Definition resourcerestrictionpolicy.cpp:49
void free(JobPointer) override
free() is called after the job has been executed.
Definition resourcerestrictionpolicy.cpp:73
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Feb 21 2025 11:46:49 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Feb 21 2025 11:46:49 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.