Multitasking without thrashing