Thread State

A thread is always in one of four states. The state of the thread is maintained in its thread data structure for use by the operating system. A good understanding of thread state is helpful in designing your application, since it leads to a better understanding of how the operating system will behave.

- Running
  Only one thread in the system is in running state at a time. This is the thread that is currently executing on the CPU.

- Runnable
  A thread in runnable state is ready to run, but it is not running because some other thread has higher priority. It will gain control of the CPU once it becomes the highest-priority runnable thread.

- Stopped
  A stopped thread will not be scheduled for execution. Newly created threads are in this state. Threads are frequently stopped by the debugger, and an application may stop a thread at any time. Stopped threads become runnable via an osStartThread system call.

- Waiting
  Waiting threads are not runnable because they are waiting for some event to occur. A thread that is blocked on a message queue is in waiting state. Arrival of a message returns a waiting thread to runnable or running state.

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