INTRODUCING CONCURRENCY TO A SEQUENTIAL LANGUAGEe introduce concurrency to the object-oriented language Eiffel through a set of Class Libraries and an associated concurrent programming design method. This concurrency mechanism is well suited for client/server style distributed applications. The essential principles of sequential object-oriented programming offered by Eiffel are not sacrificed, since no changes are made to the Eiffel Language [19], or its run-time system. Our concurrency abstractions are presented as encapsulated behavior of Eiffel objects that can be inherited from the CONCURRENCY Class. Although the design described here is specific to the Eiffel language, most of these abstractions are generally applicable to other object-oriented languages such as C + + [14], and Objective-C [13].The main concurrency abstractions provided by our mechanisms are objects as processes--active objects--and an asynchronous remote method invocation with data-driven synchronization. The view of objects as processes, having a protected private state and a prescribed behavior, provides the bridge to parallelism. Also the communication/synchronization aspects of concurrent programming blend well with the method invocation model of computation in object-oriented programming.There have been numerous proposals in recent years to combine concurrent programming with object-oriented programming. We can identify three distinct approaches for introducing concurrency to object-oriented systems:
Design a new concurrent object-oriented languageCOmMUN|CATmONm OP TMm ACN September 1993/Vol.36, No.9 103 C:OMMUNICATIONSOPTNIIACM Scptcmber 1993/Vol,36, No.9 SOS storage put( Item: DATA ): BOOLEAN is -do if not buffer, full then buffer.put (Item);-append to buffer Result:= true; else --return false for failure Result:= false; end; --if end; --put get: DATA is -do if not buffer.empty then buffer.remove; -remove the oldest item in buffer Result := buffer.item; -return the removed item else --return a Void object for failure Result.Forget;--Result made Void end; --if end; --get end --class BUFFER