Thread Functions

There are eight functions associated with threads. Please refer to the reference (man) pages for specifics about the arguments, return values, and behavior of these functions.

- osCreateThread
  This function is called once per thread to notify the system that a thread is to be created. Creating a thread initializes its thread data structure with the starting program counter, initial stack pointer, and other information. Once the thread data structure has been initialized, the thread can be run.

- osDestroyThread
  This function removes a thread from the system. Once called, the thread cannot be run any more.

- osYieldThread
  This function notifies the operating system that the running thread wishes to yield the CPU to any other thread with higher or equal priority. If all other runnable threads have lower priority, the running thread will continue. (In practice, it is not possible for a runnable thread to have higher priority than the running thread.)

- osStartThread
  This function call makes a thread runnable. If the specified thread is of higher priority than the running thread, the running thread will yield the CPU. If not, the running thread will continue and the started thread will wait until it becomes the highest priority thread in the system.

- osStopThread
  This function changes the state of a thread to stopped, after which the thread will not be able to run until restarted. If the thread was waiting on a message queue, it will be removed from that queue.

- osGetThreadId
  This function returns the ID of a thread assigned when the thread was created. It is used only by the debugger.

- osSetThreadPri
  This function changes the priority of a thread. If the running thread is no longer the highest-priority runnable thread in the system as a result of this change, it will yield the CPU to the new highest-priority thread.

- osGetThreadPri
  This function returns the running thread’s priority level.

Copyright © 1999 Nintendo of America Inc. All Rights Reserved Nintendo and N64 are registered trademarks of Nintendo Last Updated January, 1999