4 SPDX-FileCopyrightText: 2004-2013 Mirko Boehm <[email protected]>
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
38 explicit ResourceRestrictionPolicy(int cap = 0);
39 ~ResourceRestrictionPolicy() override;
42 * Capping the amount of jobs will make sure that at max the number of jobs executing at any time is
43 * limited to the capped amount. Note that immediately after setting the amount of running jobs may be
49 bool canRun(JobPointer) override;
50 void free(JobPointer) override;
virtual void release(quint64 objid)
QueuePolicy is an interface for customizations of the queueing behaviour of jobs.
ResourceRestrictionPolicy is used to limit the number of concurrent accesses to the same resource.