In Chapter 14, you saw how one process can create many threads. A program that needs to do several things at once usually creates threads rather than whole new processes. Threads are generally preferable to processes because they are created more quickly with less overhead, they share resources such as handles and variables, and they are easy to synchronize. This chapter shows what happens when you decide to divide a task among several distinct processes, each with its own threads and its own private address space.
Processes and pipes are closely related topics. Processes often pass pipe handles to new processes they create in order to establish a channel for exchanging information. Along with the threads and synchronization objects you read about in Chapter 14, pipes and processes form the basic core of tools for multitasking in Windows 98. In this chapter, you’ll learn how to launch a new child process, pass it handles, connect the parent to the child with a pipe, and send information through the pipe.