ThreadSwitchWithDelay

Reschedules the thread to be placed on the RunList after n number of context switches have taken place

Local Servers:blocking
Remote Servers:N/A
Classification:3.12, 3.2, 4.x, 5.x, 6.x
Service:Thread

Syntax

  #include <nwthread.h> 
    
  void ThreadSwitchWithDelay  (void); 
  

Return Values

None

Remarks

If a thread needs a resource that will not be ready for a moment but does not want the overhead of sleeping on a semaphore, rather than rescheduling itself repetitively the thread can reschedule itself with a temporary handicap.

Temporarily handicapped threads are scheduled on a waiting queue, the DelayedList, until their handicap has expired. Upon expiration, they are rescheduled at the end of the RunList. Letting threads temporarily handicap themselves prevents needless rescheduling caused by a spin-waiting condition.

The number of switches in each temporary handicap is a tunable parameter inside the NetWare OS.