Concurrent Computing - Coordinating Access To Resources

Coordinating Access To Resources

One of the major issues in concurrent computing is preventing concurrent processes from interfering with each other. For example, consider the following algorithm for making withdrawals from a checking account represented by the shared resource balance:

1 bool withdraw( int withdrawal ) 2 { 3 if ( balance >= withdrawal ) 4 { 5 balance -= withdrawal; 6 return true; 7 } 8 return false; 9 }

Suppose balance=500, and two concurrent threads make the calls withdraw(300) and withdraw(350). If line 3 in both operations executes before line 5 both operations will find that balance > withdrawal evaluates to true, and execution will proceed to subtracting the withdrawal amount. However, since both processes perform their withdrawals, the total amount withdrawn will end up being more than the original balance. These sorts of problems with shared resources require the use of concurrency control, or non-blocking algorithms.

Because concurrent systems rely on the use of shared resources (including communication media), concurrent computing in general requires the use of some form of arbiter somewhere in the implementation to mediate access to these resources.

Unfortunately, while many solutions exist to the problem of a conflict over one resource, many of those "solutions" have their own concurrency problems such as deadlock when more than one resource is involved.

Read more about this topic:  Concurrent Computing

Famous quotes containing the words access and/or resources:

    The professional celebrity, male and female, is the crowning result of the star system of a society that makes a fetish of competition. In America, this system is carried to the point where a man who can knock a small white ball into a series of holes in the ground with more efficiency than anyone else thereby gains social access to the President of the United States.
    C. Wright Mills (1916–1962)

    But, with whatever exception, it is still true that tradition characterizes the preaching of this country; that it comes out of the memory, and not out of the soul; that it aims at what is usual, and not at what is necessary and eternal; that thus historical Christianity destroys the power of preaching, by withdrawing it from the exploration of the moral nature of man; where the sublime is, where are the resources of astonishment and power.
    Ralph Waldo Emerson (1803–1882)