49.3 Preemption

NetWare 5.0 and later support preemption, but the only way to make an NLM preemptible is through XDC data. If you are using CodeWarrior IDE, you need PDK 5 to access and configure the mpkxdc.exe utility.

If you are using command line tools, your makefile should have a command similar to the following:

  my_nlm.xdc:
     mpkxdc.exe -p $@
  

Replace my_nlm with the name of your NLM. The p option indicates that the application is preemptible. If your application is multithreaded, you will want to also use the n option in the command.

In addition, your link definition file must contain a command similar to the following:

  xdcdata  my_nlm.xdc
  

Replace my_nlm with the name of your NLM.

Besides linking your NLM for preemption, your thread must be executing the code with the following characteristics for preemption to occur:

Linking your code as preemptible does relieve you of the requirement to yield at appropriate places. If a preemptible thread spends most of its time calling library routines from a nonpreemptible library, this can result in a CPU hog abend. Because NetWare runs in an environment that requires and expects applications to voluntarily relinquish CPU control, an application that tries to run continually will cause an abend and cannot pass NetWare certification. For more information, see the following: