Next: , Previous: Processor Control, Up: Processor Interface


9.2.3 Processors and Sets

— Function: kern_return_t processor_assign (processor_t processor, processor_set_t processor_set, boolean_t wait)

The function processor_assign assigns processor to the set processor_set. After the assignment is completed, the processor only executes threads that are assigned to that processor set. Any previous assignment of the processor is nullified. The master processor cannot be reassigned. All processors take clock interrupts at all times. The wait argument indicates whether the caller should wait for the assignment to be completed or should return immediately. Dedicated kernel threads are used to perform processor assignment, so setting wait to FALSE allows assignment requests to be queued and performed faster, especially if the kernel has more than one dedicated internal thread for processor assignment. Redirection of other device interrupts away from processors assigned to other than the default processor set is machine-dependent. Intermediaries that interpose on ports must be sure to interpose on both ports involved in this call if they interpose on either.

This function returns KERN_SUCCESS if the assignment has been performed, KERN_INVALID_ARGUMENT if processor is not a processor, or processor_set is not a processor set on the same host as processor.

— Function: kern_return_t processor_get_assignment (processor_t processor, processor_set_name_t *assigned_set)

The function processor_get_assignment obtains the current assignment of a processor. The name port of the processor set is returned in assigned_set.