White RoomNEW White Room DSA

Amortizing The Switch

lmbench measures a context switch on this machine at 3.2 microseconds. The timer interrupt fires every 250 microseconds, and a time slice must be a whole number of timer periods.

You want switching to consume less than 1 percent of wall-clock time, where the overhead fraction of a slice is

overhead=cq+c,c=3.2 μs\text{overhead} = \frac{c}{q + c}, \quad c = 3.2\ \mu s

What is the shortest legal time slice qq that meets the target?