Goals of this Article

Multitasking, the ability to execute more than one task at once, is becoming increasingly important in the small-system world.

A form of time sharing, multitasking was originally invented in the days of punched cards, when a computer was so expensive that it was important to share it efficiently between many users. Multitasking as a pursuit of resource efficiency has actually led to new uses for computers (as E-mail), new approaches to them (as interactive programming), and new ideas of their operation (distributed processing).

Today, personal computers dominate the landscape. They allow millions of people to have their own computer at their fingertips. Unfortunately, many of the great mainframe concepts for resource management have been lost in this popularization of computers. But, as personal computers become more powerful and their users want to do more with them, the concepts are being rediscovered.

The most notable rediscovery on today's PC scene is multitasking. The Terminate-but-Stay-Resident (TSR) utilities found on the IBM PC and the Desk Accessories found on the Macintosh point to the need for multitasking. However, these are ``hacked'' solutions; the personal computer industry, in its youth, lacks understanding of multitasking issues.

Only recently have software and computer manufacturers started to create multitasking environments for their users (as Apple's Multifinder or, more notably, Microsoft's OS/2). But unfortunately for the user and software developer, these environments are still highly machine and operating system dependent.2.

This article aims to help you explore and appreciate multitasking; it also aims show you how to use multitasking to enhance your programs, and to know its limitations. Multitasking has much to offer to the efficency, functionality, and modularity of your programs, but it is a tradeoff of power for complexity.

This article is in two main sections. The first section, The Dimensions of Concurrent Processing, addresses the issue of multitasking understanding; it is a brief tutorial of the concepts and issues involved in multitasking, or more generally, concurrent processing. The second section, The Mailbox Multitasker, addresses the issue of multitasking portability; it presents a general-purpose multitasker, written in `C', which is portable to most stack-based machines and even many stack-based languages. By including this multitasker in your programs, you will not only give them the efficiency, power, and conceptual simplicity of a multitasking environment, but will be able to easily port them to new environments.