Next: , Previous: Thread Information, Up: Thread Interface


7.1.4 Thread Settings

— Function: kern_return_t thread_wire (host_priv_t host_priv, thread_t thread, boolean_t wired)

The function thread_wire controls the VM privilege level of the thread thread. A VM-privileged thread never waits inside the kernel for memory allocation from the kernel's free list of pages or for allocation of a kernel stack.

Threads that are part of the default pageout path should be VM-privileged, to prevent system deadlocks. Threads that are not part of the default pageout path should not be VM-privileged, to prevent the kernel's free list of pages from being exhausted.

The functions returns KERN_SUCCESS if the call succeeded, KERN_INVALID_ARGUMENT if host_priv or thread was invalid.

The thread_wire call is actually an RPC to host_priv, normally a send right for a privileged host port, but potentially any send right. In addition to the normal diagnostic return codes from the call's server (normally the kernel), the call may return mach_msg return codes.