Thread attributes

Thread attributes are thread characteristics that affect the behavior of the thread. Different attributes are available depending on the programming language and the API that you are using.

Methods for using an attribute and its effect on the thread depend on how the programming language and the API externalize the thread attribute to your application. You can set the thread attributes at the time you start a thread or change them after the thread is actively running.

Some common thread attributes and their effects are as follows:
  • Priority

    The priority attribute affects the amount of processing time that the system gives the thread before letting another thread or process interrupt it.

  • Stack size

    The stack size attribute affects the number of functions that a thread can call before the thread fails due to insufficient stack space.

  • Name

    The name attribute affects the ability to debug or track the actions of a thread through your application.

  • Thread group

    The thread group attribute affects the ability to easily manage more than one thread at a time.

  • Detach state

    The detach state attribute affects how you reclaim or leave active resources associated with a thread when a thread ends.

  • Scheduling policy

    The scheduling policy attribute affects how the threads are scheduled within the system or within the application. This relates to thread priority.

  • Inherit scheduling

    The inherit scheduling attribute affects how the priority of the thread is determined by the system.