Donner SVG main
0.8.0 ยท 766e862a0.8.0 main
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
donner::tasks::SchedulerTestHooks Class Referenceabstract

Test seam: called at each SchedulerStep with the index of the worker the step concerns. More...

#include "donner/base/tasks/TaskScheduler.h"

Public Member Functions

virtual WorkerThreadCreate workerThreadCreate (std::size_t)
 Returns the platform create function to use for the zero-based startup attempt.
virtual int setWorkerQos (WorkerQos qos)
 Applies the worker's platform QoS hint, or injects a refusal in a test.
virtual void at (SchedulerStep step, std::size_t worker)=0
 Called at step.
virtual bool lastAwakeRule () const
 Whether the last-awake rule applies.
virtual bool allowParallelismWake () const
 Lets a test isolate the mandatory publish handshake when an optional wake hint is missed.

Detailed Description

Test seam: called at each SchedulerStep with the index of the worker the step concerns.

Production schedulers have none, and each step then costs one branch on a search, wait or wake transition. A supplied hook must outlive the scheduler and any resumption publication or join registration still returning after its continuation ran.

Member Function Documentation

◆ at()

virtual void donner::tasks::SchedulerTestHooks::at ( SchedulerStep step,
std::size_t worker )
pure virtual

Called at step.

Parameters
stepThe protocol step.
workerThe worker the step concerns: the sleeper, the woken worker or the finisher; zero for SchedulerStep::AfterPublishPush, SchedulerStep::AfterStopFlagSet and the scope steps on a non-worker. SchedulerStep::AfterAdoptedPush reports the slot index.

◆ lastAwakeRule()

virtual bool donner::tasks::SchedulerTestHooks::lastAwakeRule ( ) const
inlinenodiscardvirtual

Whether the last-awake rule applies.

Tests that must be observed failing without the rule return false; with it off, the last awake worker waiting past its margin sleeps even when work is queued.


The documentation for this class was generated from the following file: