Preemptive mode programming overview

Under the preemptive scheduling mode, all threads are executable at the same time and are handled by the Windows scheduler. Preemptive scheduling prevents a single thread from monopolizing the server. When running your application under 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 offers better performance for applications running under Windows because synchronizing threads incurs no overhead.

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

This section offers information about Windows-specific preemptive programming using the srv_sleep and srv_wakeup calls.