NAME | SYNOPSIS | FEATURES | DESCRIPTION | RETURN VALUE | ERRORS | RESTRICTIONS | ATTRIBUTES | SEE ALSO
#include <sched/chSched.h>int threadBind(KnCap *actorcap, KnThreadLid threadli, KnCpuId newcpunb, KnCpuId *oldcpunb, KnBindId bindid);
SCHED_FIFO, SCHED_CLASS
On a Shared Memory Processor based Architecture, a thread is bound by default to the processor on which threadCreate was performed. The thread binding can be changed using threadBind.
The threadBind system call binds the thread whose local identifier is threadli, in the actor whose capability is given by actorcap, to the processor designated by newcpunb.
If the thread is currently running on a different processor, it is cancelled and scheduled for execution on the processor specified.
If actorcap is K_MYACTOR, the thread is a thread of the current actor. In this case, if threadli is K_MYSELF, the current thread is used.
If newcpunb is K_SAMECPU, the thread keeps its current binding and the function returns the current binding if oldcpunb is not a null pointer.
The bindid parameter defines the type of binding applied to threadli. In the current release, the K_NONEXCLUSIVE binding type is mandatory.
Upon successful completion K_OK is returned, otherwise a negative error code is returned.
actorcap is an inconsistent actor capability, or threadli is not a valid thread identifier in the specified actor, or newcpunb is not a valid processor number, or bindid is not a valid binding type.
actorcap does not specify a reachable actor.
Some of the data provided are outside the current actor's address space.
For a given thread, threadBind is not performed from the CPU of the current (old) binding or threadBind is called on a site running a kernel configured for uniprocessor architecture only.
bindId is not a valid binding type.
The target thread and the current thread must be located on the same site.
See attributes(5) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
---|---|
Interface Stability | Evolving |
NAME | SYNOPSIS | FEATURES | DESCRIPTION | RETURN VALUE | ERRORS | RESTRICTIONS | ATTRIBUTES | SEE ALSO