|
TASH_SCH_EXTERN int | schAllocateTaskPool (schTaskSch **pSch) |
| Allocate task scheduler object. It will make sure that for any version of the library, that the size of the internal structure are of correct size. More...
|
|
TASH_SCH_EXTERN int | schCreateTaskPool (schTaskSch *sch, int cores, unsigned int flag, unsigned int maxPackagesPool) |
| Initilize task scheduler internal data structure. More...
|
|
TASH_SCH_EXTERN int | schReleaseTaskSch (schTaskSch *sch) |
| Release all resources associated with the scheduler object. More...
|
|
TASH_SCH_EXTERN void | schSetInitCallBack (schTaskSch *sch, schUserCallBack callBack) |
| Set initialization callback that will be invoked when the scheduler starts. More...
|
|
TASH_SCH_EXTERN void | schSetDeInitCallBack (schTaskSch *sch, schUserCallBack callBack) |
| Set user deinitialize callback that will be invoked when the scheduler gets terminated. More...
|
|
TASH_SCH_EXTERN void | schSetSchUserData (schTaskSch *sch, const void *user) |
| Assign user data associated with the scheduler object. More...
|
|
TASH_SCH_EXTERN void | schSetPoolUserData (schTaskSch *sch, int index, const void *user) |
| Assign user data associated with the scheduler objects pools. More...
|
|
TASH_SCH_EXTERN void * | schGetPoolUserData (schTaskSch *sch, int index) |
| Get pool user data. More...
|
|
TASH_SCH_EXTERN schTaskPool * | schGetPool (schTaskSch *sch, int index) |
| Get scheduler pool by index. More...
|
|
Info
Example code for how to create, start, submit task, finally release the task internal resources.
...
Your code.
...
TASH_SCH_EXTERN int schCreateTaskPool(schTaskSch *sch, int cores, unsigned int flag, unsigned int maxPackagesPool)
Initilize task scheduler internal data structure.
TASH_SCH_EXTERN int schAllocateTaskPool(schTaskSch **pSch)
Allocate task scheduler object. It will make sure that for any version of the library,...
TASH_SCH_EXTERN int schReleaseTaskSch(schTaskSch *sch)
Release all resources associated with the scheduler object.
Task scheduler main struct container.
Definition: internal_structures.h:75
◆ schAllocateTaskPool()
Allocate task scheduler object. It will make sure that for any version of the library, that the size of the internal structure are of correct size.
- Since
- 0.2.0
- Parameters
-
pSch | valid pointer object. |
- Returns
- non-negative if successfully.
◆ schCreateTaskPool()
Initilize task scheduler internal data structure.
- See also
- schAllocateTaskPool for how to create and allocate schTaskSch object.
- Parameters
-
sch | object reference. |
cores | number of pool that will be allocated. -1 will select number of pools that matches the number of cores. |
flag | properties. |
maxPackagesPool | Sets the max number of task on each pool can have in the queue at any given moment. |
- Returns
- non-negative if successfully released.
- Since
- 0.1.0
◆ schReleaseTaskSch()
Release all resources associated with the scheduler object.
- Parameters
-
- Returns
- non-negative if successfully released.
- Since
- 0.1.0
◆ schSetInitCallBack()
Set initialization callback that will be invoked when the scheduler starts.
- Parameters
-
sch | scheduler object. |
callBack | non-null function pointer. |
- Since
- 0.1.0
◆ schSetDeInitCallBack()
Set user deinitialize callback that will be invoked when the scheduler gets terminated.
- Since
- 0.1.0
- Parameters
-
sch | scheduler object. |
callBack | non-null function pointer. |
◆ schSetSchUserData()
Assign user data associated with the scheduler object.
- Since
- 0.1.0
- Parameters
-
sch | valid scheduler object. |
user | valid pointer. |
◆ schSetPoolUserData()
Assign user data associated with the scheduler objects pools.
- Parameters
-
sch | valid scheduler object. |
index | valid pool index, where \( index \in [0, nrPools -1] \). |
user | valid pointer. |
- See also
- schGetPoolUserData
◆ schGetPoolUserData()
Get pool user data.
- Since
- 0.1.0
- Parameters
-
sch | schedule object. |
index | valid pool index, where \( index \in [0, nrPools -1] \). |
- Returns
- non-null pointer if user pointer exists, NULL otherwise.
- See also
- schSetPoolUserData
◆ schGetPool()
Get scheduler pool by index.
- Since
- 0.1.0
- Parameters
-
- Returns
- non-null if the index is valid.