Two kinds of multitasking

People don’t task switch like computers do.

The earliest versions of Windows and Mac OS used cooperative multitasking. A Windows program would do some small unit of work in response to a message and then relinquish the CPU to the operating system until the program got another message. That worked well, as long as all programs were written with consideration for other programs and had no bugs. An inconsiderate (or inexperienced) programmer might do too much work in a message handling routine and monopolize the CPU. A bug resulting in an infinite loop would keep the program from ever letting other programs run.

Now desktop operating systems use preemptive multitasking. Unix used this form of multitasking from the beginning. Windows starting using preemptive multitasking with Windows NT and Windows 95. Macintosh gained preemptive multitasking with OS X. The operating system preempts programs to tell them it’s time to give another program a turn with the CPU. Programmers don’t have to think about handing over control of the CPU and so programs are easier to write. And if a program runs into an infinite loop, it only hurts itself.

Computers work better with preemptive multitasking, but people work better with cooperative multitasking.

If you want to micro-manage people, if you don’t trust them and want to protect yourself against their errors, treat them like machines. Interrupt them whenever you want. Preemptive task switching works great for machines.

But people take more than a millisecond to regain context. (See Mary Czerwinski’s comments on context re-acquisition.) People do much better if they have some control over when they stop one thing and start another.

Related post: Inside the multitasking and marijuana study

4 thoughts on “Two kinds of multitasking

  1. There’s another two kinds of multitasking.
    There’s symmetric multitasking, which most computers these days use. With SMT, the load’s distributed to each processor more or less equally. (This isn’t true in practice because that isn’t the most efficient use of current processors, but it’s mostly true.)
    There’s also asymmetric multitasking, where one processor is “blessed,” and decides what work other processors could do. It’s not uncommon to see a different hardware architecture between the coordinator and the workers. In general, it’s not as efficient a use of resources. With the right kinds of problems though, throughput scales almost linearly with each added processor, which is better than you’ll see with SMT.
    I’m sure that you could generalize this to how organizations work.

    (And just as a side note TCP under 16 bit Windows was a bear to to ues because of cooperative multitasking issues. The Sybase/Microsoft DBLib database library could easily be corrupted if you were doing anything else using networking. Their solution was to go to the 32 bit CTLib library.)

  2. There are still roles for pre-emptive though. An anecdote from my own experience: I used to spend a great deal of time on IRC, and questions and replies to me could come at widely spaced intervals – 10 seconds, 100 seconds, 1000 seconds, etc. I of course would be off doing something else like Wikipedia editing. I discovered myself doing a disconcerting amount of switching back to my IRC client just to see whether someone had replied and then immediately switching back. It seemed to increase my anxiety as well. When I realized this, I set irssi to ring the bell on such messages, and I reconfigured Xmonad to yank me to irssi from whatever I was doing whenever the bell rang. Thereupon I found the constant checking was no longer such a problem.

Comments are closed.