Multitasking without thrashing

Lessons from operating systems teach how to do multitasking without thrashing.