Scheduling

Open Server provides concurrency by periodically suspending the running thread and resuming another. This context switch can occur frequently and quickly so that, from the point of view of an Open Server client, threads run continuously.

The scheduler is the runtime system thread that performs context switches. A thread has an execution context that includes its stack and its machine register environment. The scheduler saves the execution context of the running thread, selects the thread to resume, restores its context, and runs it. Although the scheduler works invisibly, to write Open Server code you should understand: