Interaction between concurrently executing fragments is an essential characteristic of parallel programs and the major source of difference between sequential programming and parallel programming. Synchronization and communication are the two ways in which fragments directly interact, and these are the subjects of this chapter. We begin with a brief review of basic operating system concepts, particularly in the context of parallel and concurrent execution. If you already have a good knowledge of operating systems concepts, browse lightly or skip ahead.
Question: Who controls the executing fragments? How do different executing fragments interact and impact each other’s execution?
Threads and Processes
Computing systems are managed by a program: an operating system. Process is the mechanism that operating systems use to start and control the execution of other programs. A process provides one or more ranges of addresses for the executing program to use. Each address has a value (which remains undefined until it is initialized). Each range is mapped to a block of memory (which may reside on one or more attached devices). These blocks of memory are under management of the operating system. A range of addresses and the data that they map to are collectively called an address space. An address space is divided into fixed-size units called pages. Address space and pages provide a logical or a virtual view of the memory. This view is also called virtual memory. The operating system maintains a mapping between pages and their locations on the device. One advantage of virtual memory is that not all pages need to be resident in the physical memory device – some may be relegated to slower storage (not unlike the cache strategy), while others that remain undefined need not be mapped to any storage at all.
Being an executing program, the operating system comprises a set of processes, which start and schedule other processes. For example, an application starts with some running process launching a new process to execute that application's code. These processes may execute concurrently, sharing the available hardware by turn. An executing process may be forced to turn over to a waiting process via a mechanism of hardware interrupts.
Review the options below to login to check your access.
Log in with your Cambridge Higher Education account to check access.
If you believe you should have access to this content, please contact your institutional librarian or consult our FAQ page for further information about accessing our content.