More than one Open Server thread can be running at the same time, and one can be preempted in favor of another. This has the benefit of increased concurrency, especially in SMP systems. However, it does require code to be thread-safe. This applies to Open Server code, the user's event handlers and callback functions.
When SRV_S_PREEMPT is set to CS_TRUE. When it is, multiple Open Server threads execute concurrently and are preempted in favor of each other by the operating system. These threads are unbound.
If SRV_S_PREEMPT is set to CS_FALSE, one Open Server thread cannot be preempted by another Open Server thread, and two Open Server threads cannot run at the same time.
A single mutex is enabled whenever an Open Server thread resumes executing. The mutex is released when an Open Server thread is ready with a specific task and after the SRV_C_SUSPEND callback is executed. There is only one server-wide mutex for this.The callback functions SRV_C_RESUME and SRV_C_SUSPEND are never invoked when the operating system resumes such a thread. These functions are invoked only when a specific Open Server thread stops or resumes execution; for instance, when a language request arrives for a user Open Server thread, and before it goes to sleep after running the language event handler.