Preemptive mode programming

In preemptive scheduling mode, all threads are executable at the same time. Thread scheduling is handled by Windows. Preemptive scheduling prevents a single thread from monopolizing the server. When running your application in the preemptive mode, your application can use the debugger’s thread facility to manipulate threads. It can also perform blocking operations without bringing the server to a halt. Preemptive mode can offer better performance for applications that do not share much data between threads.

NoteTo guarantee portability to platforms where only co-routine scheduling is available, always protect global data using the Server-Library mutex facility rather than using the Windows-specific semaphore APIs.

Windows-specific preemptive programming uses the srv_sleep and srv_wakeup calls.