Class task is an abstract base class. You must override method task::execute. Method execute should perform the necessary actions for running the task, and then return the next task to execute, or NULL if the scheduler should choose the next task to execute. Typically, if non-NULL, the returned task is one of the predecessor tasks of this. Unless one of the recycle/reschedule methods, described in Section Recycling Tasks, is called while method execute() is running, the this object will be implicitly destroyed after method execute returns.
Override the virtual destructor if necessary to release resources allocated by the constructor.
Override note_affinity to improve cache reuse across tasks, as described in Section Affinity.
When the scheduler decides that a thread should begin executing a task, it performs the following steps: