Task Scheduler  3d2d7233
Scheduler functionalities.

Functions

TASH_SCH_EXTERN int schRunTaskSch (schTaskSch *sch)
 
TASH_SCH_EXTERN int schStopTaskSch (schTaskSch *sch, long int timeout_nanoseconds)
 
TASH_SCH_EXTERN int schTerminateTaskSch (schTaskSch *sch)
 
TASH_SCH_EXTERN int schSubmitTask (schTaskSch *sch, schTaskPackage *package, schTaskPool *pPool)
 
TASH_SCH_EXTERN int schClearTask (schTaskSch *sch, schTaskPool *pool)
 
TASH_SCH_EXTERN int schClearAllTask (schTaskSch *sch)
 
TASH_SCH_EXTERN int schWaitTask (schTaskSch *sch)
 
TASH_SCH_EXTERN int schWaitTaskWait (schTaskSch *sch, long int wait_nanoseconds)
 
TASH_SCH_EXTERN int schPoolLock (schTaskPool *pool)
 
TASH_SCH_EXTERN int schPoolMutexUnLock (schTaskPool *pool)
 

Detailed Description

Function Documentation

◆ schRunTaskSch()

TASH_SCH_EXTERN int schRunTaskSch ( schTaskSch sch)

Start running task scheduler. This will create the internal thread for each pool followed by the startup sequence.

See also
schSetInitCallBack for setup a custom callback before starting the pool.
Since
0.1.0
Parameters
schvalid scheduler object.
Returns
positive if successfully. otherwise failure.

◆ schStopTaskSch()

TASH_SCH_EXTERN int schStopTaskSch ( schTaskSch sch,
long int  timeout_nanoseconds 
)

Stop all current tasks.

Since
0.1.0
Parameters
schvalid scheduler object.
timeout_nanosecondshow long it w
Returns
non-negative if succesfull.

◆ schTerminateTaskSch()

TASH_SCH_EXTERN int schTerminateTaskSch ( schTaskSch sch)

Terminate the scheduler.

Since
0.1.0
Parameters
schvalid scheduler object.
Returns
non-negative if succesfull.

◆ schSubmitTask()

TASH_SCH_EXTERN int schSubmitTask ( schTaskSch sch,
schTaskPackage package,
schTaskPool pPool 
)

submit a task packet, it will be assigned accordingly to the priority queue, unless user specifies which pool it will be foced onto.

Remarks
When overriding the pool that the task will be assigned that result in both performance lost and failure from being queue being full.
Since
0.1.0
Parameters
schvalid scheduler object.
packagevalid task package, that will be sumbitted to the pools.
pPoolspecific pool queue.
Returns
non-negative if successfull, otherwise failure.

◆ schClearTask()

TASH_SCH_EXTERN int schClearTask ( schTaskSch sch,
schTaskPool pool 
)

Remove all tasks on all of the pools on the scheduler. But if the pool argument is specified it will clear only a single specific pool.

Since
0.1.0
Parameters
sch
pool
Returns
non-negative if successfull, otherwise failure.

◆ schClearAllTask()

TASH_SCH_EXTERN int schClearAllTask ( schTaskSch sch)
See also
schClearTask will be executed similar.
Parameters
sch
Returns
non-negative if successfull, otherwise a errorcode.

◆ schWaitTask()

TASH_SCH_EXTERN int schWaitTask ( schTaskSch sch)

Wait for all pool to finish with all their tasks.

Since
0.1.0
Parameters
schvalid scheduler object.
Returns
non-negative if successfully.

◆ schWaitTaskWait()

TASH_SCH_EXTERN int schWaitTaskWait ( schTaskSch sch,
long int  wait_nanoseconds 
)

Wait for all pool to finish with all their tasks.

Since
0.1.0
Parameters
schvalid scheduler object.
wait_nanosecondstime in nano seconds.
Returns
non-negative if successfully.

◆ schPoolLock()

TASH_SCH_EXTERN int schPoolLock ( schTaskPool pool)

Lock current task pool in current function

Since
0.1.1
Parameters
poolvalid pool object.
Returns
non-negative if successfull, otherwise failure.

◆ schPoolMutexUnLock()

TASH_SCH_EXTERN int schPoolMutexUnLock ( schTaskPool pool)

Unlock current task pool in current function

Since
0.1.1
Parameters
poolvalid pool object.
Returns
non-negative if successfull, otherwise failure.