| United States-English |
|
|
|
![]() |
Parallel Programming Guide for HP-UX Systems > Chapter 6 Parallel
optimization featuresIdle thread states |
|
Idle threads can be suspended or spin-waiting. Suspended threads release control of the processor while spin-waiting threads repeatedly check an encached global semaphore that indicates whether or not they have code to execute. This obviously prevents any other process from gaining control of the CPU and can severely degrade multiprocess performance. Alternately, waking a suspended thread takes substantially longer than activating a spin-waiting thread. By default, idle threads spin-wait briefly after creation or a join, then suspend themselves if no work is received. When threads are suspended, HP-UX may schedule threads of another process on their processors in order to balance machine load. However, threads have an affinity for their original processors. HP-UX tries to schedule unsuspended threads to their original processors in order to exploit the presence of any data encached during the thread’s last timeslice. This occurs only if the original processor is available. Otherwise, the thread is assigned to the first processor to become available. Use the MP_IDLE_THREADS_WAIT environment variable to determine how threads wait. The form of the MP_IDLE_THREADS_WAIT environment variable is shown in Table 6-1 “Form of MP_IDLE_THREADS_WAIT environment variable”. Table 6-1 Form of MP_IDLE_THREADS_WAIT environment variable
where
By default, idle threads spin-wait briefly after creation or a join. They then suspend themselves if no work is received. |
||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||