ThreadSwitch

Allows other runnable threads a chance to get some work done, where no natural break in the currently running thread would normally occur

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

Syntax

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

Return Values

None

Remarks

The NetWare 3.x, 4.x, 5.x, and 6.x environment is a nonpreemptive environment in which threads can only relinquish control via system calls. Unless an executing thread relinquishes control, other threads do not have the opportunity to work.

If no natural break occurs via a system call in a particular thread, ThreadSwitch can be used to cause that thread to relinquish control and allow other runnable threads to execute.

NOTE:If you are using "busy waiting" or "spin locks" you should use ThreadSwitchWithDelay instead of ThreadSwitch because threads preempted with ThreadSwitch still have higher priority than threads on the low priority queue. These low priority threads (such as those doing file compression in the OS) still need an opportunity to run in the nonpreemptive 4.x, 5.x, and 6.x environment.