Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Threads Module User's Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

2.1 Background

Many applications can benefit from the use of concurrency in their implementation. In a concurrent model of execution, an application is divided into two or more processes or threads, each executing its own sequence of statements or instructions. An application may consist of one or more processes and a process may consist of one or more threads. Execution may be distributed on two or more machines in a network, two or more processors in a single machine, or may be interleaved on a single processor.

These separately executing processes or threads must generally compete for access to shared resources and data and must cooperate in order to accomplish their overall task.

Concurrent application development is a complicated task. Some of the critical design decisions to be made include the identification of the number of processes and threads required, their particular responsibilities, and the methods by which they will interact. Also key to this development is the identification of good, legal, or invariant program states and bad or illegal program states. The critical problem is to find and implement a solution that maintains or guarantees good program states while prohibiting bad program states, even in those situations where there may be two or more processes or threads acting on the same resource or data.

In a concurrent environment, maintaining desirable program states is accomplished by limiting or negotiating access to shared resources through use of synchronization. The principal role of synchronization is to prevent undesirable or unanticipated interference between simultaneously executing instruction sequences.

Many of today's operating systems now provide support for multithreading and synchronization. This support takes the form of a low-level procedural API accessed as C language functions.

Using a native API poses many problems:

The Threads Module attempts to alleviate or eliminate these problems using the implementation features described in the following chapters.



Previous fileTop of DocumentContentsNo linkNext file

Copyright © Rogue Wave Software, Inc. All Rights Reserved.

The Rogue Wave name and logo, and SourcePro, are registered trademarks of Rogue Wave Software. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.