TASKCREATE(3P) TASKCREATE(3P)
taskcreate - create a new task
#include <task.h>
tid_t taskcreate (char *name, void (*entry)(), void *arg,
int sched);
Taskcreate causes a new task to be created for the calling process/task.
The new task is created via the sproc(2) system call, requesting that all
attributes (e.g. open files, current directory, uid, etc.) be shared.
The new task differs from the calling task as described in sproc(2).
The new task will be invoked as follows:
entry(arg)
void *arg;
The sched parameter is currently unused and should be set to 0.
No implicit synchronization is implied between tasks - they are free to
run on any processor in any sequence. Synchronization must be provided
by the application using locks and semaphores (see usinit(3P)).
Each created task has a task block allocated. The task blocks are linked
together and pointed to by taskheader. The task block structure is
defined in task.h.
Taskcreate will fail and no new task will be created if one or more of
the following are true:
The sproc(2) system call fails.
[ENOMEM] The required memory for the task block or task name was
not available.
sproc(2), taskblock(3P), taskctl(3P), taskdestroy(3P).
Upon successful completion, taskcreate returns the task id of the new
task. The task id is guaranteed to be the smallest available.
Otherwise, a value of -1 is returned to the calling task, and errno is
set to indicate the error.
PPPPaaaaggggeeee 1111 [ Back ]
|