**6.2.2 Deferrable server**

When the workload of a deferrable server *σ<sup>i</sup>* is exhausted, i.e. there are no ready tasks in *γ*(*σi*), then the server is switched out and its server queue *σi*.*sq* is deactivated. Consequently, any periodic task which could wake up the server to consume any remaining budget cannot be noticed. One could alleviate this problem by keeping its server queue active when *σ<sup>i</sup>* is switched out. This, however, would make the tick handler overhead linear in the number of deferrable servers, since a tick handler decrements the head events in all active queues (see Section 6.6).

Instead, in order to limit the interference of inactive deferrable servers, when a deferrable server *σ<sup>i</sup>* is switched out and it has no workload pending (i.e. no tasks in *γ*(*σi*) are ready), we deactivate the *σi*'s server queue, change its state to waiting, and insert a *wakeup event*, denoted as *σi*.*we*, into the system queue. The wakeup event has its *data* pointing to *σ<sup>i</sup>* and time equal to the arrival of the first event in *σi*.*sq*. When the wakeup event expires, the *σi*'s state is set to the ready state. This way handling the events inside *σi*.*sq* is deferred until *σ<sup>i</sup>* is switched in.

When a deferrable server is switched in while it is in the waiting state, its wakeup event *σi*.*we* is removed from the system queue.
