13.07.2015 Views

An Operating Systems Vade Mecum

An Operating Systems Vade Mecum

An Operating Systems Vade Mecum

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

chapter 9CO-OPERATING PROCESSESIn Chapter 8, we concentrated on the contention issues raised by multiple activities. Theopposite of contention is co-operation. In this chapter, we will see ways in whichprocesses can co-operate and what the operating system might provide to promote suchco-operation.A simple form of co-operation is when an interactive command interpreter starts anew process in response to a command and then waits until that process completes beforeprompting for the next command. A more complex form, pioneered by Unix, is to solveproblems by building fairly simple processes and linking them together so that their jointbehavior is more complex. For example, assume that we wish to list the names of all thefiles in a directory in alphabetical order. We could have the directory-listing programaccept a #Sorted flag. The Unix-style alternative is to connect the output of thedirectory-listing program to the input of the sorting program. This philosophy reducesthe responsibilities of ordinary programs because they will need to provide only limitedservices, not fancy ones that can be placed in other programs.The recent advent of networks of computers linked together in various ways hasgiven great impetus to the search for mechanisms for inter-process co-operation. Thechallenge raised by these networks is for the operating system to provide an environmentfor processes so that they can do their work no matter what machine they are on and nomatter what other processes they need to communicate with.This chapter deals with process interactions. We will start by seeing how one processcan create another. Then we will see how processes can communicate with eachother. We will close by seeing how communicating processes can form co-operatingcommunities.294

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!