Next: Processor Set Priority, Previous: Processor Set Destruction, Up: Processor Set Interface
The function
processor_set_tasks
gets send rights to the kernel port for each task currently assigned to processor_set.task_list is an array that is created as a result of this call. The caller may wish to
vm_deallocate
this array when the data is no longer needed. task_count is set to the number of tasks in the task_list.This function returns
KERN_SUCCESS
if the call succeeded andKERN_INVALID_ARGUMENT
if processor_set is not a processor set.
The function
processor_set_thread
gets send rights to the kernel port for each thread currently assigned to processor_set.thread_list is an array that is created as a result of this call. The caller may wish to
vm_deallocate
this array when the data is no longer needed. thread_count is set to the number of threads in the thread_list.This function returns
KERN_SUCCESS
if the call succeeded andKERN_INVALID_ARGUMENT
if processor_set is not a processor set.
The function
task_assign
assigns task the set processor_set. This assignment is for the purposes of determining the initial assignment of newly created threads in task. Any previous assignment of the task is nullified. Existing threads within the task are also reassigned if assign_threads isTRUE
. They are not affected if it isFALSE
.This function returns
KERN_SUCCESS
if the assignment has been performed andKERN_INVALID_ARGUMENT
if task is not a task, or processor_set is not a processor set on the same host as task.
The function
task_assign_default
is a variant oftask_assign
that assigns the task to the default processor set on that task's host. This variant exists because the control port for the default processor set is privileged and not usually available to users.This function returns
KERN_SUCCESS
if the assignment has been performed andKERN_INVALID_ARGUMENT
if task is not a task.
The function
task_get_assignment
returns the name of the processor set to which the thread is currently assigned in assigned_set. This port can only be used to obtain information about the processor set.This function returns
KERN_SUCCESS
if the assignment has been performed,KERN_INVALID_ADDRESS
if processor_set points to inaccessible memory, andKERN_INVALID_ARGUMENT
if task is not a task.
The function
thread_assign
assigns thread the set processor_set. After the assignment is completed, the thread only executes on processors assigned to the designated processor set. If there are no such processors, then the thread is unable to execute. Any previous assignment of the thread is nullified. Unix system call compatibility code may temporarily force threads to execute on the master processor.This function returns
KERN_SUCCESS
if the assignment has been performed andKERN_INVALID_ARGUMENT
if thread is not a thread, or processor_set is not a processor set on the same host as thread.
The function
thread_assign_default
is a variant ofthread_assign
that assigns the thread to the default processor set on that thread's host. This variant exists because the control port for the default processor set is privileged and not usually available to users.This function returns
KERN_SUCCESS
if the assignment has been performed andKERN_INVALID_ARGUMENT
if thread is not a thread.
The function
thread_get_assignment
returns the name of the processor set to which the thread is currently assigned in assigned_set. This port can only be used to obtain information about the processor set.This function returns
KERN_SUCCESS
if the assignment has been performed,KERN_INVALID_ADDRESS
if processor_set points to inaccessible memory, andKERN_INVALID_ARGUMENT
if thread is not a thread.