1. Motivation concurrent-OO languages provide maximum computatinal and modeling power through concurrency of objects, encapsulation and code re-use. It has been found that synchronization code cannot be inherited without non-trivial redefinitions, this phenomenon is known as Inheritance Anomaly. Inheritance Anomaly is more severe than violation of class encapsulation in sequential language. Inheritance anomaly entails a severe drawback for the development of large-scale and complex systems in Object Oriented Concurrent Programming(OOCP) languages because greatest benefit of using the OO framework are inheritance and encapsulation. Better more reusable, mechanisms are needed to create ...view middle of the document...
This phenomenon forcing of redefinitions of inherited methods in order to maintain the integrity of concurrent objects is called inheritance anomaly. The scheme for achieving object wise synchronization is called synchronization scheme of language. Inheritance anomaly depends on the synchronization scheme of language. The semantical conflicts between the descriptions of object-wise synchronization and inheritance within the language leads to Inheritance anomaly. Redefinitions would be required for classes in an OOCP language that adopted a certain synchronization scheme, while the semantically identical classes could be safely inherited in another language that provides an entirely different synchronization scheme.Consider following cases where benefit of inheritance is lost.Definition of new subclass K' of class of K necessitates re-definitions of methods in K as well as those in its ancestor classes.Modification of new method m of class K within the inheritance hierarchy incur modification of the methods in both parent and descendent classes of K.Definition of a method m might force the other methods including those to be defined at the subclass in future to follow a specific protocol which would not have been required had that method not existed. Encapsulated definition of mix-in classes would thus be very difficult.4. Analysis of Inheritance Anomaly When a concurrent object is in a certain state, it can accept only a subset of its entire set of messages in order to maintain its internal integrity. Such a restriction on acceptable messages is called synchronization constraint of concurrent object. Synchronization constraints specify the circumstances under which an object's methods may be invoked. Synchronization code is the portion of method code where object behavior with respect to synchronization is controlled. The synchronization code must always be consistent with the synchronization constraint of an object otherwise the object might accept a message that it really should not accept resulting in a semantical error during program execution. In order to program the synchronization code the programming language must provide some primitives for object wise synchronization like semaphores, guards, etc. We will consider well known example of bounded buffer in various synchronization scheme and see different ways in which Inheritance Anomaly can appears.Let us first consider Bounded Buffer with put and get operation executing concurrently (See Example 1). The synchronization scheme in this example is called behavior abstraction, a variant of the accept-set based scheme. It is object-based and each object has behavior and mailbox. On receiving a message, an object can send messages to any of its acquaintances, any object referenced in the received message, and any objects created during execution of the script. An object's mailbox holds messages that have arrived but not yet been processed. A object becomes locked when it begins executin...