Object Synchronizer: A Design Pattern for Object Synchronization

Size: px
Start display at page:

Download "Object Synchronizer: A Design Pattern for Object Synchronization"

Transcription

1 Synchronizer: A Design Pattern for António Rito Silva 1, João Pereira 2 and José Alves Marques 1 1 INESC/IST Technical University of Lisbon, Rua Alves Redol n o 9, 1000 Lisboa, PORTUGAL 2 INRIA, Domaine de Voluceau, Rocquencourt, B.P. 105, Le Chesnay Cedex, FRANCE Rito.Silva@acm.org, Joao.Pereira@inria.fr, jam@inesc.pt This pattern was workshopped at the European Conference of Pattern Languages of Programs (EuroPLoP96), Kloster Irsee, Germany, July, Abstract This paper describes the Synchronizer pattern which decouples object synchronization from object functionality. This pattern supports several synchronization policies and their customization. This pattern is used when invocations to an object need to be controlled in order to preserve its consistency. The solution described by this pattern provides encapsulation, modularity, extensibility and reuse of synchronization policies. 1. Intent The Synchronizer pattern abstracts several object synchronization policies. It decouples object synchronization from object functionality. 2. Also Known As Concurrency Control. Serialization. 3. Motivation 3.1. Example Consider the design of a Cooperative Drawing Application allowing cooperative manipulation of graphical documents. Users at different terminals can simultaneously access the same graphical document and changes made to a local view are immediately propagated to other local views. Due to the cooperative characteristics of the application a shape can be made private, publicly readable or publicly writable. A shape is private when it is only visible to the user that has created it: its owner. A shape is publicly readable when it is visible to all users but only its owner can update it. A shape is publicly writable when any user can see and modify it. A possible architecture for such an application contains several client applications having their own objects (application space) and sharing a set of domain objects (domain space) which may be kept in a data store (persistent space). The application space has interface objects, e.g scrollbars and shapes; the domain space has shared objects, e.g. shapes data; and the persistent space stores documents, e.g. a graphical document including its shapes data Problem Client applications execute operations that invoke methods on shape objects. Invocations on a non-private shape object must be controlled either because it is a publicly readable shape where update invocations from non-owners should return an error; or because it is a publicly writable shape where simultaneous invocations by different client applications are liable to result in corruption of the shared shape s state. Traditional solutions for object synchronization use: The persistent space s locking mechanisms to synchronize invocations to shared resources. However, a shared object may just be volatile and the effort to make it persistent may result in unacceptable overhead. Another issue is that the supported locking mechanisms may not be suitable for the synchronization needs of the application. mechanisms, as semaphores [1] and monitors [2], to synchronize accesses. However, this results in code tangling which forbids, both functionality and synchronization independent reuse. For instance, a shape s functionality code should be the 1

2 same for private, publicly readable or publicly writable shapes Forces An object-oriented solution for the object synchronization problem must resolve the following forces: Extensibility requires abstraction of synchronization policies. It is not possible to find an optimal policy for all situations: policies should be customizable. The most suitable policy depends on the domain object and its operations semantics. For instance, some domain objects are frequently accessed, thus requiring a pessimistic policy, whereas others are not, making the use of an optimistic policy more efficient. Modularity requires separation of object synchronization from object functionality. This orthogonality allows synchronization policy switching with no repercussions on other components, as well as incremental introduction of synchronization. Encapsulation requires the synchronization part of an object to be placed within the object itself rather than spread out among its clients. This places synchronization responsibility within the object, thereby avoiding client negligence. Reusability requires separate reuse of functionality and synchronization code. It should be possible to independently reuse both synchronization code and functionality code. For instance, a shape functionality code is reused for private, publicly readable and publicly writable shape classes Solution Figure 1 sketches a solution for the synchronization of a Shape object. Client Shape Interface moveby() Policy precontrol() postcontrol() Shape moveby() synchronization->precontrol() shape->moveby() synchronization->postcontrol() Figure 1. Synchronized Shape. Invocations on a Shape are intercepted by a Shape Interface that can let them proceed or can delay or reject them. The Shape Interface synchronizes invocations delegating on Policy. Operations precontrol and postcontrol of the Policy control the order of invocations according to a given synchronization policy. Extensibility is achieved by providing different implementations of the Policy. Each implementation provides a specific synchronization semantics. Actually, due to synchronization complexity, Policy class is a Façade [3] encapsulating several synchronization objects. Modularity is achieved through the implementation of synchronization in Policy class and so it is decoupled from Shape. Encapsulation is achieved because the Shape Interface isolates synchronization from the Client. Reusability is achieved because a Shape objects can be associated with different Policy objects. This allows independent reuse of Shape and Policy classes. 4. Applicability Use the Synchronizer pattern when: Invocations to an object must be controlled to preserve its consistency - invocations must be controlled according to a synchronization policy. It is premature to decide on which object synchronization policy to use. - At initial stages of the development process it may be too early to choose a specific policy. Moreover it should be possible to test several policies before choosing. Different synchronization policies may be used by different objects of a class - different synchronization and sharing semantics 1 are often required by applications, e.g. groupware systems. 5. Structure and Participants The UML [4] class diagram in Figure 2 illustrates the structure of the Synchronizer pattern. The main participants in the Synchronizer pattern are: 1 For objects of the same or different classes. 2

3 Client Interface m() Synchronizer precontrol() postcontrol() invocations * Functional m () status require() postguard() pre() post() require, preguard and postguard. For validation purposes, these operations may use their local synchronization data, the synchronization data of other invocations (contained in other objects) and the object synchronization data (contained in object ). Operations preguard and postguard verify whether an invocation is compatible with other concurrent invocations while operation require controls access according to the object state. Operations pre, exec, post, commit and abort update synchronization data.. Provides global object synchronization data. It may use the Functional to get synchronization data. Figure 2. Synchronizer Pattern Structure. Client. Requires a service from Functional, by invoking one of its operations through Interface. Functional. Contains the functionality code and data. Accesses to it should be synchronized. Interface. Is responsible for the synchronization of invocations to the Functional using the services provided by the Synchronizer. It creates a object for each invocation. It invokes precontrol before invocation proceeds on the Functional and postcontrol after. Synchronizer. It decides whether an invocation may continue, stop or should be delayed (returns values, ERROR and ). Operations precontrol and postcontrol control the order of invocations. The former enforces pessimistic synchronization policies while the latter enforces optimistic synchronization policies.. Identifies the invocation and contains its current status which can be: pre-pending, executing, post-pending, committed and aborted (attribute status with values PRE, EXEC, POST, COMMIT and ABORT). It also contains a queue of predicates: invocations. Defines the synchronization semantics of an invocation through operations 6. Collaborations The UML sequence diagram in Figure 3 illustrates collaborations between objects involved in the Synchronizer pattern. CREATE PRE-CONTROL POST-CONTROL EXECUTION a Interface m() new() *xstatus== xstatus = precontrol() m () *xstatus== xstatus = postcontrol() a Synchronizer xstatus = require() xstatus = xstatus = postguard() [xstatus==] post() a pre() a Functional Figure 3. Synchronizer Pattern Collaborations. Four collaboration phases are described: 1. CREATE. Corresponds to an access made by a Client object. This phase creates a object. Its status is initialized to PRE. Operation pre may update policy-specific synchro- 3

4 nization data with information about the invocation category and its argument values. 2. PRE-CONTROL. This phase synchronizes the invocation before accessing the Functional (operations require and preguard). An ERROR value may be returned, preventing the execution of the client invocation, otherwise execution is delayed or resumed. If or ERROR values are returned, the status is updated to, respectively, EXEC or ERROR by operations exec and abort. These operations may also update policy-specific synchronization data in and objects. This phase is repeated while precontrol returns. 3. EXECUTION. The invocation executes on the Functional. This phase occurs only if the previous phase returned. 4. POST-CONTROL. This phase verifies if an invocation already done (in state EXEC or POST), is correctly synchronized with other concurrent invocations. The verification protocol (operation postguard) is similar to that of the previous phase. Operations post, commit, and abort, on the object, set the status value to POST, COMMIT, and ABORT respectively. Additionally, they may update policy-specific synchronization data in and other objects. This phase is repeated while postcontrol returns. Operations pre, precontrol and postcontrol must be executed in mutual exclusion since any interference may result in synchronization data corruption. 7. Consequences The Synchronizer pattern has the following advantages: Isolates synchronization code from client objects, allowing the shared object to enforce a consistent synchronization policy. Clients can ignore whether an object is shared or not, which simplifies them. Encapsulation is achieved by placing the synchronization code within the synchronized object such that client objects can invoke the Interface ignoring how synchronization is achieved. Separates functionality code from synchronization code, allowing separate development, test and reuse. code is encapsulated by classes Synchronizer, and. Abstracts several synchronization policies, like readers/writers, synchronization counters, or dynamic priority. The policies can be either optimistic or pessimistic. This extensibility is achieved by specializing classes Synchronizer, and. This pattern has the following disadvantage: Increases the number of classes and objects. More classes and objects are needed than in a solution based on synchronization mechanisms as semaphores. However, due to code tangling, this solution is more complex and error prone. 8. Implementation 8.1. Customization of Policies Programmers customize synchronization policies by defining specific subclasses of Synchronizer, and. There are several ways to implement Synchronizer pattern. This section discusses major issues and possibilities. Pessimistic and Optimistic Policies. policies can use two different generic algorithms: pessimistic, when the object is expected to have high contention; and optimistic, when the level of contention is expected to be low. These two perspectives are coded in subclasses of Synchronizer as illustrated in Figure 4. Pessimistic policies control invocations during the PRE-CONTROL phase by verifying compatibility with other objects (operations require and preguard). During POST-CONTROL, pessimistic policies do not verify compatibility, since synchronizations were already verified (thus operation postguard is not invoked). Optimistic policies do not control invocations during the PRE-CONTROL phase. Nevertheless, operation require must be invoked to verify whether an object s state allows invocation execution, e.g. it may not be possible to get a value from an empty buffer. Afterwards, during the POST-CONTROL phase it is necessary to verify if the invocation is compatible with other executing and terminated invocations (operation postguard). 4

5 precontrol() a Pessimistic Synchronizer xstatus = require() xstatus = a precontrol() a Optimistic Synchronizer xstatus = require() a Optimistic Readers/Writers. Class and sequence diagrams described in Figure 6 show the specialization of for an optimistic readers/writers synchronization policy. Read/Write category abort postcontrol() postcontrol() xstatus = postguard() [xstatus==] post() [category==read] getcategory() setabort() [category==write] postguard() ERROR [abort] [NOT abort] Read Write a Read a Write Figure 4. Pessimistic and Optimistic Synchronizers. *invocations c = getcategory() *invocations [s==exec] setabort() [s==exec && c==write] setabort() Pessimistic Readers/Writers. Class and sequence diagrams presented in Figure 5 show the specialization of for a pessimistic readers/writers synchronization policy. a Read [category==read] *invocations Read Read/Write category getcategory() Write [category==write] a Write *invocations Figure 6. Optimistic Readers/Writers Policy. Operation postguard of Read/Write objects returns ABORT if the abort attribute has the value TRUE. Operation commit of Read sets the attribute abort of all Write objects whose status is EXEC to TRUE. Operation commit of Write sets the attribute abort of all predicate objects whose status is EXEC to TRUE. We assume that each access to the shared object is done in a private copy. If afterwards the invocations terminates with success, we actualize the shared object. This corresponds to the deferred-update recovery policy of the Recovery pattern [5]. s = getcategory() [s==exec && c==write] [s===exec] Figure 5. Pessimistic Readers/Writers Policy. This solution distinguishes between read and write invocations. A generic synchronization predicate Read/Write defines the invocation categories, e.g. READ and WRITE. Operation preguard of Read returns if one of the invocations predicates is a Write with status value EXEC, i.e., there is another client invocation that is accessing the shared object in write mode. Operation preguard of Write returns if there is an invocations predicate with status value EXEC. Dynamic Priority Readers/Writers. The pessimistic readers/writers policy allows starvation of writers. To solve this problem, whenever a read starts executing, the priority of pending write invocations is incremented. Class and sequence diagrams presented in Figure 7 show the specialization of for a dynamic priority readers/writers synchronization policy. Operation preguard of Read returns if there is a Write with MAX priority and operation exec of Read increments the priority of Write. Producer/Consumer. Class and sequence diagrams presented in Figure 8 show the specialization of and for a producer/consumer synchronization policy. 5

6 [category==read] Read a Read Read/Write category getcategory() *invocations c = getcategory() [category==write] Write priority getpriority() incpriority() a Read a Write *invocations c = getcategory() [s==pre && c==write] incpriority() *invocations c = getcategory() Specializations of class can implement synchronization counters using an attribute for each counter. Moreover, it is necessary that operations pre, exec, post, commit and abort of class invoke the to update the attribute values accordingly. Note that the previously described readers/writers policies could have been written using synchronization counters. [c==write] p = getpriority() [(s==exec && c==write) (s==pre && c==write && p==max)] [c==write] p = getpriority() [(s==exec) (s==pre && c==write && priority<p)] 8.2. Separation of Functional and Variables Figure 7. Dynamic Priority Readers/Writers Policy. Producer/Consumer category getcategory() Producer/consumer policies can have different implementations of class Buffer : this class either accesses the functional object to obtain synchronization information or holds and manages its own synchronization variables. Top and bottom sequence diagrams presented in Figure 9 show the two possible implementations. [category==produce] [category==consume] Buffer Produce Consume isempty() isfull() Functional Functional b = isfull() num = getnumitems() b = isempty() num = getnumitems() a Produce require() b = isfull() a Consume require() b = isempty() TRUE FALSE [num==size] [num<size] TRUE FALSE [num==0] [num>0] [b==true] [b==false] [b==true] [b==false] a Produce a Consume incnumitems() decnumitems() Figure 8. Producer/Consumer Policy. Class Buffer contains information about the number of items in the buffer. Operation require of Produce returns if the synchronization information contained in Buffer indicates that the buffer is full. Operation require of Consume returns if the synchronization information contained in Buffer indicates that the buffer is empty. Note that operations preguard or postguard should be redefined if state corruption can result from the concurrent execution of produce or consume operations. Counters. Several concurrent objectoriented languages, e.g. Guide [6], provide synchronization counters which count, for each type of invocation, the number of pending, executing and finished invocations. Figure 9. Variables. The top solution reduces concurrency, because synchronization verification conflicts with invocation execution, e.g. a variable written during an invocation execution is read during the PRE-CONTROL phase of another invocation. The bottom solution completely separates the functional variables from the synchronization variables. Besides the increment in concurrency, the bottom solution allows the independent reuse of the synchronization policy because it does not depend on the functional object interface. For instance, if programmers only distinguish among consume and produce invocations they can use the presented synchronization classes for producer/consumer policies. By using customized synchronization classes, programmers of the functional class do not need to be aware of the structure and collaborations of the Synchronizer pattern. 6

7 8.3. Transparency Transparency can be achieved if the Functional and the Interface have the same interface. In that situation the Client can ignore whether the object is synchronized or not. Nevertheless, there are situations where the Client must be aware of synchronization. For instance, the Client can receive an error if the invocation is rejected. In this situation, transparency can be relaxed by enriching the Interface according to the Client s synchronization requirements. Although there is transparency loss, this does not imply break of encapsulation: synchronization is still not the client s responsibility Concurrency Two policies of object concurrency are considered: active object and concurrent object. Active objects have an internal activity that selects and executes invocations, while invocations to concurrent objects can execute concurrently, for instance, using the caller s activity. A synchronized object can either be active or concurrent. If it is an active object its Interface encapsulates a single internal activity which accesses the synchronization objects and the functional object. On the other hand, if it is a concurrent object the synchronization objects and the functional object can be concurrently accessed by several activities. So, because of object concurrency policies, object synchronization requires different implementations of mutual exclusion and activity delay/resume services. Both implementations are orthogonal to synchronization code. Concurrent. A mutex object is used to support mutual exclusion of synchronization code. A condition object is used to block the activity associated with an invocation if is returned. Active. The design of an active object is described in [7]. It contains a queue of method objects representing pending invocations. A method object has the code associated with an invocation. Active objects use a scheduler object to select and execute pending method objects. Mutual exclusion of synchronization code is provided by the internal scheduler thread. Activity delay is implemented by moving the invocation to the end of the queue. 9. Sample Code This section presents the implementation of shape objects belonging to the Cooperative Drawing Application. In the Cooperative Drawing Application accesses to shared shapes need to be synchronized. The implementation of private, publicly readable and publicly writable shapes is described for pessimistic policies. Class Shape represents a shape. It knows its data and how to update it when the shape is moved (operation moveby). The interface definition is as follows. class Shape public: Shape( data); Shape(); // Move - update data void moveby(point delta); // Read data get(); private: // Shape data data; ; Class Shape implements a private shape since its objects are not shared. To support public shapes class Shape Interface, subclass of Interface, is defined. The synchronization associated with operation moveby is shown below. This class uses a concurrent object policy and so Mutex and Condition objects are used to support mutual exclusion in the synchronization code and invocation delays and resumes. void ShapeInterface::moveBy(Point delta) X_Status status; // creates a predicate MoveByPred * pred = new MoveBy(); // pre-control do // begin mutual exclusion mutex_.acquire(); // verify compatibility status = synchronizer_->precontrol(pred); // end mutual exclusion mutex_.release(); // if there are incompatibilities wait if (status == ) condition_.wait(); while (status == ); if (status == ) // invocation proceeds on functional object shape_ shape_->moveby(delta); else return; // post-control do // begin mutual exclusion mutex_.acquire(); 7

8 // verify compatibility status = synchronizer_->postcontrol(pred); // end mutual exclusion mutex_.release(); if (status == ) condition_.wait(); else // only if or ERROR // awake pending invocations condition_.broadcast(); while (status == ); Note that, since pre-control and post-control code fragments are independent of a particular invocation it could be defined as two protected operations of class Interface. For each synchronized operation, these generic operations could be invoked receiving a object as argument. Particular synchronization policies are defined by classes MoveBy and Get which are subclasses of Shape. Shape inherits from and defines two invocation categories: MOVE and GET. // Generic shape predicate class Shape : public public: Shape(int cat) : cat_(cat) Shape() // returns category int getcat() return cat_; // other operations to be redefined //... private: // Invocation categories: MOVE and GET CAT cat_; ; A publicly readable shape defines Get to allow concurrent execution of get invocations. Class MoveBy restricts invocations of moveby to the shape s owner and forbids concurrent execution of moveby invocations. Operation get is a read operation while moveby is a private write operation. // prevents conflicts with executing moveby X_Status Get:: // iterator for predicates PIterator iter(sync_); *pred; while (pred = iter.next(), pred!= 0) // there are moveby invocations executing if ((pred->getstatus() == EXEC) && (((Shape*)pred)->getCat() == MOVE)) // conflict return ; // no conflict return ; // prevents conflicts with executing get and moveby X_Status MoveBy:: // iterator for predicates PIterator iter(sync_); *pred; while (pred = iter.next(), pred!= 0) // there are invocations executing if ((pred->getstatus() == EXEC)) // conflict return ; // no conflict return ; // requires that invoker is shape s owner X_Status MoveBy::require() // InvOwner global function returns invoker id // sd_ is an instance of a // subclass which contains the shape s owner if (InvOwner() == sd_->owner()) return ; return ERROR; A publicly writable shape allows any user to move the shape. The synchronization predicates are identical to publicly readable shape s synchronization predicates except for predicate MoveBy which has to relax the require operation. // publicly writable moveby require // any user can move the shape X_Status MoveBy::require() return ; 10. Known Uses The need for object synchronization is widely recognized in concurrent programming languages, objectoriented databases, and distributed object systems. Most solutions to this problem restrict the supported number of policies and do not decouple synchronization from concurrency. Distributed systems, e.g. Arjuna [8] and Hermes/ST [9], use the Synchronizer pattern encapsulated by platform mechanisms. Arjuna defines two classes, Lock and LockManager: class LockManager supports a pessimistic synchronization policy while class Lock contains object-specific information. Programmers only need to redefine Lock operations. In Hermes there are two kinds of synchronization: implicit and explicit. Implicit synchronization offers a transparent pessimistic policy to synchronize invocations with attribute granularity, while explicit synchronization uses the object s state. Explicit synchronization defines class ProgrammableLock which has two operations: isscheduable and iscompatiblewith. The former uses the object s state while the latter defines the compatibility between operations. Scheduling predicates were defined in [10] in the context of a concurrent object-oriented language. This language 8

9 contains identical abstractions and synchronization expressibility as Synchronizer pattern. The Synchronizer pattern is integrated with other design patterns: Concurrency and Recovery [5]. It is implemented as part of an object-oriented framework that supports object concurrency, synchronization and recovery [11]. This framework is publicly available from ars/dasco. 11. Related Patterns The Active pattern [7] decouples operation execution from operation invocation in order to simplify synchronized accesses to a shared resource. The active object has an internal thread which dispatches pending operations. The internal thread can do some synchronization when selecting the next operation to dispatch. The Synchronizer abstracts synchronization policies independently of a particular implementation of object concurrency such as active object. The Recovery pattern [5] abstracts several policies for object recovery. Combined with the Synchronizer pattern it allows implementation of synchronization policies that need to recover the object s state, e.g. optimistic policies. However, some combinations of synchronization and recovery policies are not possible or, although possible, penalize performance. It has been proven that some compatibility relations between invocations require a particular kind of recovery policy [12], e.g. forward commutativity requires an update-in-place recovery policy. Common combinations are optimistic policies and deferredupdate recovery policies, where simultaneous invocations proceed on a copy of the object (optimized abort), and pessimistic with update-in-place recovery policies (optimized commit), where invocations proceed on the same object. The Proxy pattern [3] is used to control accesses to the Functional. The Functional corresponds to RealSubject while the Interface corresponds to Proxy. The Functional does not know anything about the Interface. The Strategy pattern [3] is used between the Interface and the Synchronizer. It provides the configuration of Interface with synchronization policies. References [1] E. W. Dijkstra. Cooperating Sequential Processes. In F. Genuys, editor, Programming Languages. Academic Press, [2] C. A. R. Hoare. Monitors: An Operating System Structuring Concept. Comunications of the ACM, 17(10), October [3] Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides. Design Patterns: Elements of Reusable - Oriented Software. Addison Wesley, [4] Martin Fowler and Kendall Scott. UML Destilled: Applying de Standard Modeling Language. Addison-Wesley, [5] António Rito Silva, Joao Pereira, and José Alves Marques. Recovery. In Robert Martin, Dirk Riehle, and Frank Buschman, editors, Pattern Languages of Program Design 3, chapter 15, pages Addison-Wesley, [6] D. Decouchant, P. Le Dot, M. Riveill, C. Roisin, and X. Rousset de Pina. A synchronization mechanism for an object-oriented distributed system. In Proceedings of the 11th International Conference on Distributed Computing Systems, pages , Arlington, Texas, USA, May [7] R. Greg Lavender and Douglas C. Schmidt. Active : an Behavioral Pattern for Concurrent Programming. In John M. Vlissides, James O. Coplien, and Norman L. Kerth, editors, Pattern Languages of Program Design 2, pages Addison-Wesley, [8] Santosh K. Shrivastava, Graeme N. Dixon, and Graham D. Parrington. An overview of the arjuna distributed programming system. IEEE Software, pages 66 33, January [9] Michael Fazzolare, Bernhard G. Humm, and R. David Ranson. Concurrency control for distributed nested transactions in hermes. International Conference for Concurrent and Distributed Systems, [10] Ciaran McHale, Bridget Walsh, Sean Baker, and Alexis Donnelly. Scheduling s. In Mario Tokoro, Oscar Nierstrasz, and Peter Wegner, editors, Proceedings of the ECOOP 91 Workshop on -based Concurrent Computing, volume 612, pages Springer-Verlag, [11] António Rito Silva. Development and Extension of a Three- Layered Framework. In Saba Zamir, editor, Handbook of Technology, chapter 27. CRC Press, [12] William Weihl. The Impact of Recovery in Concurrency Control. Journal of Computer and System Sciences, 47(1): , August Acknowledgments. Thanks to our colleagues Pedro Sousa, David Matos, Luís Gil and João Martins. We also thank the participants of the EuroPLoP 96 writers workshop on Distribution. 9

Distributed Proxy: A Design Pattern for Distributed Object Communication

Distributed Proxy: A Design Pattern for Distributed Object Communication Distributed Proxy: A Design Pattern for Distributed Object Communication António Rito Silva, Francisco Assis Rosa, Teresa Gonçalves INESC/IST Technical University of Lisbon, Rua Alves Redol n o 9, 1000

More information

Distributed Proxy: A Design Pattern for the Incremental Development of Distributed Applications

Distributed Proxy: A Design Pattern for the Incremental Development of Distributed Applications Distributed : A Design Pattern for the Incremental Development of Distributed Applications António Rito Silva 1, Francisco Assis Rosa 2, Teresa Gonçalves 2 and Miguel Antunes 1 1 INESC/IST Technical University

More information

Applying Idioms for Synchronization Mechanisms Synchronizing communication components for the One-dimensional Heat Equation

Applying Idioms for Synchronization Mechanisms Synchronizing communication components for the One-dimensional Heat Equation Applying Idioms for Synchronization Mechanisms Synchronizing communication components for the One-dimensional Heat Equation Jorge L. Ortega Arjona 1 Departamento de Matemáticas Facultad de Ciencias, UNAM

More information

Coordination Patterns

Coordination Patterns Coordination Patterns 1. Coordination Patterns Design Patterns and their relevance for Coordination Oscar Nierstrasz Software Composition Group Institut für Informatik (IAM) Universität Bern oscar@iam.unibe.ch

More information

Topics in Object-Oriented Design Patterns

Topics in Object-Oriented Design Patterns Software design Topics in Object-Oriented Design Patterns Material mainly from the book Design Patterns by Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides; slides originally by Spiros Mancoridis;

More information

Transparent Remote Access

Transparent Remote Access Abstract Transparent Remote Access Klaus Marquardt Käthe-Kollwitz-Weg 14, D-23558 Lübeck, Germany Email: marquardt@acm.org In distributed systems, the different processors communicate via network messages.

More information

A Meta-Model for Composition Techniques in Object-Oriented Software Development

A Meta-Model for Composition Techniques in Object-Oriented Software Development A Meta-Model for Composition Techniques in Object-Oriented Software Development Bedir Tekinerdogan Department of Computer Science University of Twente P.O. Box 217, 7500 AE Enschede, The Netherlands E-Mail:

More information

Using Design Patterns in Java Application Development

Using Design Patterns in Java Application Development Using Design Patterns in Java Application Development ExxonMobil Research & Engineering Co. Clinton, New Jersey Michael P. Redlich (908) 730-3416 michael.p.redlich@exxonmobil.com About Myself Degree B.S.

More information

Partial Acquisition Prashant Jain and Michael Kircher

Partial Acquisition Prashant Jain and Michael Kircher 1 Partial Acquisition Prashant Jain and Michael Kircher {Prashant.Jain,Michael.Kircher}@mchp.siemens.de Siemens AG, Corporate Technology Munich, Germany Partial Acquisition 2 Partial Acquisition The Partial

More information

Solution: Reuse Design Patterns Design patterns support reuse of software architecture Patterns embody successful solutions to problems that arise whe

Solution: Reuse Design Patterns Design patterns support reuse of software architecture Patterns embody successful solutions to problems that arise whe Introduction Experience Using Design Patterns to Evolve Communication Software Across Diverse Platforms Developing portable, reuseable, and ecient communication software is hard OS platforms are often

More information

James Newkirk

James Newkirk Private Interface Class Structural James Newkirk newkirk@oma.com Intent Provide a mechanism that allows specific classes to use a non-public subset of a class interface without inadvertently increasing

More information

Concurrency Control with Java and Relational Databases

Concurrency Control with Java and Relational Databases Concurrency Control with Java and Relational Databases Sérgio Soares and Paulo Borba Informatics Center Federal University of Pernambuco Recife, PE, Brazil scbs,phmb @cin.ufpe.br Abstract As web based

More information

ADAPTER. Topics. Presented By: Mallampati Bhava Chaitanya

ADAPTER. Topics. Presented By: Mallampati Bhava Chaitanya ADAPTER Presented By: Mallampati Bhava Chaitanya Topics Intent Motivation Applicability Structure Participants & Collaborations Consequences Sample Code Known Uses Related Patterns Intent Convert the interface

More information

Universal Communication Component on Symbian Series60 Platform

Universal Communication Component on Symbian Series60 Platform Universal Communication Component on Symbian Series60 Platform Róbert Kereskényi, Bertalan Forstner, Hassan Charaf Department of Automation and Applied Informatics Budapest University of Technology and

More information

Control Message. Abstract. Microthread pattern?, Protocol pattern?, Rendezvous pattern? [maybe not applicable yet?]

Control Message. Abstract. Microthread pattern?, Protocol pattern?, Rendezvous pattern? [maybe not applicable yet?] Control Message An Object Behavioral Pattern for Managing Protocol Interactions Joe Hoffert and Kenneth Goldman {joeh,kjg@cs.wustl.edu Distributed Programing Environments Group Department of Computer Science,

More information

Active Object. an Object Behavioral Pattern for Concurrent Programming. R. Greg Lavender Douglas C. Schmidt

Active Object. an Object Behavioral Pattern for Concurrent Programming. R. Greg Lavender Douglas C. Schmidt Active Object an Object Behavioral Pattern for Concurrent Programming R. Greg Lavender Douglas C. Schmidt G.Lavender@isode.com schmidt@cs.wustl.edu ISODE Consortium Inc. Department of Computer Science

More information

Evictor. Prashant Jain Siemens AG, Corporate Technology Munich, Germany

Evictor. Prashant Jain Siemens AG, Corporate Technology Munich, Germany 1 Evictor Prashant Jain Prashant.Jain@mchp.siemens.de Siemens AG, Corporate Technology Munich, Germany Evictor 2 Evictor The Evictor 1 pattern describes how and when to release resources such as memory

More information

Design Patterns. Gunnar Gotshalks A4-1

Design Patterns. Gunnar Gotshalks A4-1 Design Patterns A4-1 On Design Patterns A design pattern systematically names, explains and evaluates an important and recurring design problem and its solution Good designers know not to solve every problem

More information

Idioms and Design Patterns. Martin Skogevall IDE, Mälardalen University

Idioms and Design Patterns. Martin Skogevall IDE, Mälardalen University Idioms and Design Patterns Martin Skogevall IDE, Mälardalen University 2005-04-07 Acronyms Object Oriented Analysis and Design (OOAD) Object Oriented Programming (OOD Software Design Patterns (SDP) Gang

More information

Control. CS432: Distributed Systems Spring 2017

Control. CS432: Distributed Systems Spring 2017 Transactions and Concurrency Control Reading Chapter 16, 17 (17.2,17.4,17.5 ) [Coulouris 11] Chapter 12 [Ozsu 10] 2 Objectives Learn about the following: Transactions in distributed systems Techniques

More information

Configuration Provider: A Pattern for Configuring Threaded Applications

Configuration Provider: A Pattern for Configuring Threaded Applications Configuration Provider: A Pattern for Configuring Threaded Applications Klaus Meffert 1 and Ilka Philippow 2 Technical University Ilmenau plop@klaus-meffert.de 1, ilka.philippow@tu-ilmena.de 2 Abstract

More information

Interprocess Communication By: Kaushik Vaghani

Interprocess Communication By: Kaushik Vaghani Interprocess Communication By: Kaushik Vaghani Background Race Condition: A situation where several processes access and manipulate the same data concurrently and the outcome of execution depends on the

More information

Overview of AspectOPTIMA

Overview of AspectOPTIMA COMP-667 Software Fault Tolerance Overview of AspectOPTIMA Jörg Kienzle School of Computer Science McGill University, Montreal, QC, Canada With Contributions From: Samuel Gélineau, Ekwa Duala-Ekoko, Güven

More information

Microthread. An Object Behavioral Pattern for Managing Object Execution. 1.0 Intent. 2.0 Also Known As. 3.0 Classification. 4.0 Motivation/Example

Microthread. An Object Behavioral Pattern for Managing Object Execution. 1.0 Intent. 2.0 Also Known As. 3.0 Classification. 4.0 Motivation/Example Microthread An Object Behavioral Pattern for Managing Object Execution Joe Hoffert and Kenneth Goldman {joeh,kjg}@cs.wustl.edu Distributed Programing Environments Group Department of Computer Science,

More information

Design Patterns. An introduction

Design Patterns. An introduction Design Patterns An introduction Introduction Designing object-oriented software is hard, and designing reusable object-oriented software is even harder. Your design should be specific to the problem at

More information

A FRAMEWORK FOR ACTIVE OBJECTS IN.NET

A FRAMEWORK FOR ACTIVE OBJECTS IN.NET STUDIA UNIV. BABEŞ BOLYAI, INFORMATICA, Volume LV, Number 3, 2010 A FRAMEWORK FOR ACTIVE OBJECTS IN.NET DAN MIRCEA SUCIU AND ALINA CUT Abstract. Nowadays, the concern of computer science is to find new

More information

Idioms for Building Software Frameworks in AspectJ

Idioms for Building Software Frameworks in AspectJ Idioms for Building Software Frameworks in AspectJ Stefan Hanenberg 1 and Arno Schmidmeier 2 1 Institute for Computer Science University of Essen, 45117 Essen, Germany shanenbe@cs.uni-essen.de 2 AspectSoft,

More information

Towards Better Support for Pattern-Oriented Software Development

Towards Better Support for Pattern-Oriented Software Development Towards Better Support for Pattern-Oriented Software Development Dietrich Travkin Software Engineering Research Group, Heinz Nixdorf Institute & Department of Computer Science, University of Paderborn,

More information

Object Oriented Paradigm

Object Oriented Paradigm Object Oriented Paradigm Ming-Hwa Wang, Ph.D. Department of Computer Engineering Santa Clara University Object Oriented Paradigm/Programming (OOP) similar to Lego, which kids build new toys from assembling

More information

Chapter 5 Concurrency: Mutual Exclusion and Synchronization

Chapter 5 Concurrency: Mutual Exclusion and Synchronization Operating Systems: Internals and Design Principles Chapter 5 Concurrency: Mutual Exclusion and Synchronization Seventh Edition By William Stallings Designing correct routines for controlling concurrent

More information

Concurrency. On multiprocessors, several threads can execute simultaneously, one on each processor.

Concurrency. On multiprocessors, several threads can execute simultaneously, one on each processor. Synchronization 1 Concurrency On multiprocessors, several threads can execute simultaneously, one on each processor. On uniprocessors, only one thread executes at a time. However, because of preemption

More information

Foundations of Software Engineering Design Patterns -- Introduction

Foundations of Software Engineering Design Patterns -- Introduction Foundations of Software Engineering Design Patterns -- Introduction Fall 2016 Department of Computer Science Ben-Gurion university Based on slides of: Nurit Gal-oz, Department of Computer Science Ben-Gurion

More information

Software Engineering Prof. Rushikesh K.Joshi IIT Bombay Lecture-15 Design Patterns

Software Engineering Prof. Rushikesh K.Joshi IIT Bombay Lecture-15 Design Patterns Software Engineering Prof. Rushikesh K.Joshi IIT Bombay Lecture-15 Design Patterns Today we are going to talk about an important aspect of design that is reusability of design. How much our old design

More information

Object-Oriented Software Development Goal and Scope

Object-Oriented Software Development Goal and Scope Object-Oriented Software Development Goal and Scope Koichiro Ochimizu Japan Advanced Institute of Science and Technologies School of Information Science Scope and Goal Goal enable you to understand basic

More information

Facade and Adapter. Comp-303 : Programming Techniques Lecture 19. Alexandre Denault Computer Science McGill University Winter 2004

Facade and Adapter. Comp-303 : Programming Techniques Lecture 19. Alexandre Denault Computer Science McGill University Winter 2004 Facade and Adapter Comp-303 : Programming Techniques Lecture 19 Alexandre Denault Computer Science McGill University Winter 2004 March 23, 2004 Lecture 19 Comp 303 : Facade and Adapter Page 1 Last lecture...

More information

An Introduction to Patterns

An Introduction to Patterns An Introduction to Patterns Robert B. France Colorado State University Robert B. France 1 What is a Pattern? - 1 Work on software development patterns stemmed from work on patterns from building architecture

More information

Goals of Lecture. Lecture 27: OO Design Patterns. Pattern Resources. Design Patterns. Cover OO Design Patterns. Pattern Languages of Programming

Goals of Lecture. Lecture 27: OO Design Patterns. Pattern Resources. Design Patterns. Cover OO Design Patterns. Pattern Languages of Programming Goals of Lecture Lecture 27: OO Design Patterns Cover OO Design Patterns Background Examples Kenneth M. Anderson Object-Oriented Analysis and Design CSCI 6448 - Spring Semester, 2001 April 24, 2001 Kenneth

More information

Coordinator. Example. Prashant Jain Corporate Technology, Siemens AG Munich, Germany

Coordinator. Example. Prashant Jain Corporate Technology, Siemens AG Munich, Germany Coordinator Prashant Jain pjain@gmx.net Corporate Technology, Siemens AG Munich, Germany The Coordinator design pattern describes how to maintain system consistency by coordinating completion of tasks

More information

Double-Checked Locking An Optimization Pattern for Efficiently Initializing and Accessing Thread-safe Objects

Double-Checked Locking An Optimization Pattern for Efficiently Initializing and Accessing Thread-safe Objects Double-Checked Locking An Optimization Pattern for Efficiently Initializing and Accessing Thread-safe Objects Douglas C. Schmidt schmidt@cs.wustl.edu Dept. of Computer Science Wash. U., St. Louis Tim Harrison

More information

Mobile and Heterogeneous databases Distributed Database System Transaction Management. A.R. Hurson Computer Science Missouri Science & Technology

Mobile and Heterogeneous databases Distributed Database System Transaction Management. A.R. Hurson Computer Science Missouri Science & Technology Mobile and Heterogeneous databases Distributed Database System Transaction Management A.R. Hurson Computer Science Missouri Science & Technology 1 Distributed Database System Note, this unit will be covered

More information

C++ INTERFACE CLASSES STRENGTHENING ENCAPSULATION

C++ INTERFACE CLASSES STRENGTHENING ENCAPSULATION C++ INTERFACE CLASSES STRENGTHENING ENCAPSULATION Separating a class s interface from its implementation is fundamental to good quality object oriented software design/programming. However C++ (when compared

More information

Exception Handling Alternatives (Part 2)

Exception Handling Alternatives (Part 2) Exception Handling Alternatives (Part 2) First published in Overload 31 Copyright 1999 Detlef Vollmann Resume In part 1, several alternative mechanisms for handling exceptional events were presented. One

More information

The Object Recursion Pattern

The Object Recursion Pattern SilverMark, Inc. woolf@acm.org OBJECT RECURSION Object Behavioral Intent Distribute processing of a request over a structure by delegating polymorphically. Object Recursion transparently enables a request

More information

Deadlock. Concurrency: Deadlock and Starvation. Reusable Resources

Deadlock. Concurrency: Deadlock and Starvation. Reusable Resources Concurrency: Deadlock and Starvation Chapter 6 Deadlock Permanent blocking of a set of processes that either compete for system resources or communicate with each other No efficient solution Involve conflicting

More information

Concurrency Control in Distributed Systems. ECE 677 University of Arizona

Concurrency Control in Distributed Systems. ECE 677 University of Arizona Concurrency Control in Distributed Systems ECE 677 University of Arizona Agenda What? Why? Main problems Techniques Two-phase locking Time stamping method Optimistic Concurrency Control 2 Why concurrency

More information

26.1 Introduction Programming Preliminaries... 2

26.1 Introduction Programming Preliminaries... 2 Department of Computer Science Tackling Design Patterns Chapter 27: Proxy Design Pattern Copyright c 2016 by Linda Marshall and Vreda Pieterse. All rights reserved. Contents 26.1 Introduction.................................

More information

JOURNAL OF OBJECT TECHNOLOGY Online at Published by ETH Zurich, Chair of Software Engineering. JOT, 2002

JOURNAL OF OBJECT TECHNOLOGY Online at  Published by ETH Zurich, Chair of Software Engineering. JOT, 2002 JOURNAL OF OBJECT TECHNOLOGY Online at www.jot.fm. Published by ETH Zurich, Chair of Software Engineering. JOT, 2002 Vol. 1, No. 2, July-August 2002 Representing Design Patterns and Frameworks in UML Towards

More information

Crash course on design patterns

Crash course on design patterns Crash course on design patterns Yann-Gaël Guéhéneuc guehene@emn.fr From Olivier Motelet s course (2001/10/17) École des Mines de Nantes, France Object Technology International, Inc., Canada Design patterns

More information

Patterns for Decoupling

Patterns for Decoupling Patterns for Decoupling Ingolf H. Krueger Department of Computer Science & Engineering University of California, San Diego La Jolla, CA 92093-0114, USA California Institute for Telecommunications and Information

More information

The Null Object Pattern

The Null Object Pattern Knowledge Systems Corp. 4001 Weston Pkwy, Cary, NC 27513-2303 919-677-1119 x541, bwoolf@ksccary.com NULL OBJECT Object Structural Intent Provide a surrogate for another object that shares the same interface

More information

Real-Time and Concurrent Programming Lecture 4 (F4): Monitors: synchronized, wait and notify

Real-Time and Concurrent Programming Lecture 4 (F4): Monitors: synchronized, wait and notify http://cs.lth.se/eda040 Real-Time and Concurrent Programming Lecture 4 (F4): Monitors: synchronized, wait and notify Klas Nilsson 2016-09-20 http://cs.lth.se/eda040 F4: Monitors: synchronized, wait and

More information

Applying the Observer Design Pattern

Applying the Observer Design Pattern Applying the Observer Design Pattern Trenton Computer Festival Professional Seminars Michael P. Redlich (908) 730-3416 michael.p.redlich@exxonmobil.com About Myself Degree B.S. in Computer Science Rutgers

More information

CYES-C++: A Concurrent Extension of C++ through Compositional Mechanisms

CYES-C++: A Concurrent Extension of C++ through Compositional Mechanisms CYES-C++: A Concurrent Extension of C++ through Compositional Mechanisms Raju Pandey J. C. Browne Department of Computer Sciences The University of Texas at Austin Austin, TX 78712 fraju, browneg@cs.utexas.edu

More information

Object-Oriented Design

Object-Oriented Design Object-Oriented Design Lecture 20 GoF Design Patterns Behavioral Department of Computer Engineering Sharif University of Technology 1 GoF Behavioral Patterns Class Class Interpreter: Given a language,

More information

On Object Orientation as a Paradigm for General Purpose. Distributed Operating Systems

On Object Orientation as a Paradigm for General Purpose. Distributed Operating Systems On Object Orientation as a Paradigm for General Purpose Distributed Operating Systems Vinny Cahill, Sean Baker, Brendan Tangney, Chris Horn and Neville Harris Distributed Systems Group, Dept. of Computer

More information

Object-Oriented Design

Object-Oriented Design Object-Oriented Design Lecturer: Raman Ramsin Lecture 20: GoF Design Patterns Creational 1 Software Patterns Software Patterns support reuse of software architecture and design. Patterns capture the static

More information

L23.1 Introduction... 2

L23.1 Introduction... 2 Department of Computer Science COS121 Lecture Notes: L23 Adapter Design Pattern 23 & 26 September 2014 Copyright c 2014 by Linda Marshall and Vreda Pieterse. All rights reserved. Contents L23.1 Introduction.................................

More information

Architectural Patterns

Architectural Patterns Architectural Patterns Dr. James A. Bednar jbednar@inf.ed.ac.uk http://homepages.inf.ed.ac.uk/jbednar Dr. David Robertson dr@inf.ed.ac.uk http://www.inf.ed.ac.uk/ssp/members/dave.htm SEOC2 Spring 2005:

More information

Behavioral Design Patterns Used in Data Structures Implementation

Behavioral Design Patterns Used in Data Structures Implementation Behavioral Design Patterns Used in Data Structures Implementation Niculescu Virginia Department of Computer Science Babeş-Bolyai University, Cluj-Napoca email address: vniculescu@cs.ubbcluj.ro November,

More information

Java Monitor Objects: Synchronization (Part 1)

Java Monitor Objects: Synchronization (Part 1) Java Monitor Objects: Synchronization (Part 1) Douglas C. Schmidt d.schmidt@vanderbilt.edu www.dre.vanderbilt.edu/~schmidt Institute for Software Integrated Systems Vanderbilt University Nashville, Tennessee,

More information

Chapter 9: Concurrency Control

Chapter 9: Concurrency Control Chapter 9: Concurrency Control Concurrency, Conflicts, and Schedules Locking Based Algorithms Timestamp Ordering Algorithms Deadlock Management Acknowledgements: I am indebted to Arturas Mazeika for providing

More information

Design Patterns. Architectural Patterns. Contents of a Design Pattern. Dr. James A. Bednar. Dr. David Robertson

Design Patterns. Architectural Patterns. Contents of a Design Pattern. Dr. James A. Bednar. Dr. David Robertson Design Patterns Architectural Patterns Dr. James A. Bednar jbednar@inf.ed.ac.uk http://homepages.inf.ed.ac.uk/jbednar Dr. David Robertson dr@inf.ed.ac.uk http://www.inf.ed.ac.uk/ssp/members/dave.htm A

More information

Using the Bridge Design Pattern for OSGi Service Update

Using the Bridge Design Pattern for OSGi Service Update Using the Bridge Design Pattern for OSGi Service Update Hans Werner Pohl Jens Gerlach {hans,jens@first.fraunhofer.de Fraunhofer Institute for Computer Architecture and Software Technology (FIRST) Berlin

More information

Keywords: Abstract Factory, Singleton, Factory Method, Prototype, Builder, Composite, Flyweight, Decorator.

Keywords: Abstract Factory, Singleton, Factory Method, Prototype, Builder, Composite, Flyweight, Decorator. Comparative Study In Utilization Of Creational And Structural Design Patterns In Solving Design Problems K.Wseem Abrar M.Tech., Student, Dept. of CSE, Amina Institute of Technology, Shamirpet, Hyderabad

More information

The GoF Design Patterns Reference

The GoF Design Patterns Reference The GoF Design Patterns Reference Version.0 / 0.0.07 / Printed.0.07 Copyright 0-07 wsdesign. All rights reserved. The GoF Design Patterns Reference ii Table of Contents Preface... viii I. Introduction....

More information

APPLYING DESIGN PATTERNS TO SCA IMPLEMENTATIONS

APPLYING DESIGN PATTERNS TO SCA IMPLEMENTATIONS APPLYING DESIGN PATTERNS TO SCA IMPLEMENTATIONS Adem Zumbul (TUBITAK-UEKAE, Kocaeli, Turkey, ademz@uekae.tubitak.gov.tr); Tuna Tugcu (Bogazici University, Istanbul, Turkey, tugcu@boun.edu.tr) ABSTRACT

More information

Software Engineering - I An Introduction to Software Construction Techniques for Industrial Strength Software

Software Engineering - I An Introduction to Software Construction Techniques for Industrial Strength Software Software Engineering - I An Introduction to Software Construction Techniques for Industrial Strength Software Chapter 9 Introduction to Design Patterns Copy Rights Virtual University of Pakistan 1 Design

More information

OS06: Monitors in Java

OS06: Monitors in Java OS06: Monitors in Java Based on Chapter 4 of [Hai17] Jens Lechtenbörger Computer Structures and Operating Systems 2018 1 Introduction 1.1 OS Plan ˆ OS Motivation (Wk 23) ˆ OS Introduction (Wk 23) ˆ Interrupts

More information

Ingegneria del Software Corso di Laurea in Informatica per il Management. Design Patterns part 1

Ingegneria del Software Corso di Laurea in Informatica per il Management. Design Patterns part 1 Ingegneria del Software Corso di Laurea in Informatica per il Management Design Patterns part 1 Davide Rossi Dipartimento di Informatica Università di Bologna Pattern Each pattern describes a problem which

More information

Concurrent & Distributed Systems Supervision Exercises

Concurrent & Distributed Systems Supervision Exercises Concurrent & Distributed Systems Supervision Exercises Stephen Kell Stephen.Kell@cl.cam.ac.uk November 9, 2009 These exercises are intended to cover all the main points of understanding in the lecture

More information

Semaphores and Monitors: High-level Synchronization Constructs

Semaphores and Monitors: High-level Synchronization Constructs 1 Synchronization Constructs Synchronization Coordinating execution of multiple threads that share data structures Semaphores and Monitors High-level Synchronization Constructs A Historical Perspective

More information

SOFTWARE PATTERNS. Joseph Bonello

SOFTWARE PATTERNS. Joseph Bonello SOFTWARE PATTERNS Joseph Bonello MOTIVATION Building software using new frameworks is more complex And expensive There are many methodologies and frameworks to help developers build enterprise application

More information

Operating Systems: William Stallings. Starvation. Patricia Roy Manatee Community College, Venice, FL 2008, Prentice Hall

Operating Systems: William Stallings. Starvation. Patricia Roy Manatee Community College, Venice, FL 2008, Prentice Hall Operating Systems: Internals and Design Principles, 6/E William Stallings Chapter 6 Concurrency: Deadlock and Starvation Patricia Roy Manatee Community College, Venice, FL 2008, Prentice Hall Deadlock

More information

Lecture 21: Transactional Memory. Topics: consistency model recap, introduction to transactional memory

Lecture 21: Transactional Memory. Topics: consistency model recap, introduction to transactional memory Lecture 21: Transactional Memory Topics: consistency model recap, introduction to transactional memory 1 Example Programs Initially, A = B = 0 P1 P2 A = 1 B = 1 if (B == 0) if (A == 0) critical section

More information

Applying the Decorator Design Pattern

Applying the Decorator Design Pattern Applying the Decorator Design Pattern Trenton Computer Festival Professional Seminars Michael P. Redlich (908) 730-3416 michael.p.redlich@exxonmobil.com About Myself Degree B.S. in Computer Science Rutgers

More information

Operating Systems. Designed and Presented by Dr. Ayman Elshenawy Elsefy

Operating Systems. Designed and Presented by Dr. Ayman Elshenawy Elsefy Operating Systems Designed and Presented by Dr. Ayman Elshenawy Elsefy Dept. of Systems & Computer Eng.. AL-AZHAR University Website : eaymanelshenawy.wordpress.com Email : eaymanelshenawy@yahoo.com Reference

More information

G Programming Languages Spring 2010 Lecture 13. Robert Grimm, New York University

G Programming Languages Spring 2010 Lecture 13. Robert Grimm, New York University G22.2110-001 Programming Languages Spring 2010 Lecture 13 Robert Grimm, New York University 1 Review Last week Exceptions 2 Outline Concurrency Discussion of Final Sources for today s lecture: PLP, 12

More information

Chapter 5 Concurrency: Mutual Exclusion. and. Synchronization. Operating Systems: Internals. and. Design Principles

Chapter 5 Concurrency: Mutual Exclusion. and. Synchronization. Operating Systems: Internals. and. Design Principles Operating Systems: Internals and Design Principles Chapter 5 Concurrency: Mutual Exclusion and Synchronization Seventh Edition By William Stallings Designing correct routines for controlling concurrent

More information

Command. Comp-303 : Programming Techniques Lecture 22. Alexandre Denault Computer Science McGill University Winter 2004

Command. Comp-303 : Programming Techniques Lecture 22. Alexandre Denault Computer Science McGill University Winter 2004 Command Comp-303 : Programming Techniques Lecture 22 Alexandre Denault Computer Science McGill University Winter 2004 April 1, 2004 Lecture 22 Comp 303 : Command Page 1 Last lecture... Chain of Responsibility

More information

Patterns for Asynchronous Invocations in Distributed Object Frameworks

Patterns for Asynchronous Invocations in Distributed Object Frameworks Patterns for Asynchronous Invocations in Distributed Object Frameworks Patterns for Asynchronous Invocations in Distributed Object Frameworks Markus Voelter Michael Kircher Siemens AG, Corporate Technology,

More information

An Optimal Locking Scheme in Object-Oriented Database Systems

An Optimal Locking Scheme in Object-Oriented Database Systems An Optimal Locking Scheme in Object-Oriented Database Systems Woochun Jun Le Gruenwald Dept. of Computer Education School of Computer Science Seoul National Univ. of Education Univ. of Oklahoma Seoul,

More information

Lecture 13: Design Patterns

Lecture 13: Design Patterns 1 Lecture 13: Design Patterns Kenneth M. Anderson Object-Oriented Analysis and Design CSCI 6448 - Spring Semester, 2005 2 Pattern Resources Pattern Languages of Programming Technical conference on Patterns

More information

Implementation of Process Networks in Java

Implementation of Process Networks in Java Implementation of Process Networks in Java Richard S, Stevens 1, Marlene Wan, Peggy Laramie, Thomas M. Parks, Edward A. Lee DRAFT: 10 July 1997 Abstract A process network, as described by G. Kahn, is a

More information

DP2 Report: A collaborative text editor

DP2 Report: A collaborative text editor DP2 Report: A collaborative text editor Eleftherios Ioannidis, elefthei@mit.edu Tal Tchwella, tchwella@mit.edu Larry Rudolph, R01 May 25, 2012 1 Introduction This paper describes the architecture of a

More information

Monitors; Software Transactional Memory

Monitors; Software Transactional Memory Monitors; Software Transactional Memory Parallel and Distributed Computing Department of Computer Science and Engineering (DEI) Instituto Superior Técnico October 18, 2012 CPD (DEI / IST) Parallel and

More information

Silberschatz and Galvin Chapter 18

Silberschatz and Galvin Chapter 18 Silberschatz and Galvin Chapter 18 Distributed Coordination CPSC 410--Richard Furuta 4/21/99 1 Distributed Coordination Synchronization in a distributed environment Ð Event ordering Ð Mutual exclusion

More information

A Metric of the Relative Abstraction Level of Software Patterns

A Metric of the Relative Abstraction Level of Software Patterns A Metric of the Relative Abstraction Level of Software Patterns Atsuto Kubo 1, Hironori Washizaki 2, and Yoshiaki Fukazawa 1 1 Department of Computer Science, Waseda University, 3-4-1 Okubo, Shinjuku-ku,

More information

Multitasking / Multithreading system Supports multiple tasks

Multitasking / Multithreading system Supports multiple tasks Tasks and Intertask Communication Introduction Multitasking / Multithreading system Supports multiple tasks As we ve noted Important job in multitasking system Exchanging data between tasks Synchronizing

More information

Chapter 10: Performance Patterns

Chapter 10: Performance Patterns Chapter 10: Performance Patterns Patterns A pattern is a common solution to a problem that occurs in many different contexts Patterns capture expert knowledge about best practices in software design in

More information

Pooling. Michael Kircher, Prashant Jain Corporate Technology, Siemens AG, Munich, Germany

Pooling. Michael Kircher, Prashant Jain Corporate Technology, Siemens AG, Munich, Germany 1 Pooling Michael Kircher, Prashant Jain {Michael.Kircher,Prashant.Jain@mchp.siemens.de Corporate Technology, Siemens AG, Munich, Germany Pooling 2 Pooling The Pooling pattern describes how expensive acquisition

More information

A can be implemented as a separate process to which transactions send lock and unlock requests The lock manager replies to a lock request by sending a lock grant messages (or a message asking the transaction

More information

An Introduction to Patterns

An Introduction to Patterns An Introduction to Patterns Robert B. France Colorado State University Robert B. France 1 What is a Pattern? Patterns are intended to capture the best available software development experiences in the

More information

Global shared variables. Message passing paradigm. Communication Ports. Port characteristics. Sending a message 07/11/2018

Global shared variables. Message passing paradigm. Communication Ports. Port characteristics. Sending a message 07/11/2018 Global shared variables In most RT applications, tasks exchange data through global shared variables. Advantages High efficiency Low run-time overhead Schedulability analysis is available Disadvantages

More information

IT 540 Operating Systems ECE519 Advanced Operating Systems

IT 540 Operating Systems ECE519 Advanced Operating Systems IT 540 Operating Systems ECE519 Advanced Operating Systems Prof. Dr. Hasan Hüseyin BALIK (5 th Week) (Advanced) Operating Systems 5. Concurrency: Mutual Exclusion and Synchronization 5. Outline Principles

More information

A Concurrency Control for Transactional Mobile Agents

A Concurrency Control for Transactional Mobile Agents A Concurrency Control for Transactional Mobile Agents Jeong-Joon Yoo and Dong-Ik Lee Department of Information and Communications, Kwang-Ju Institute of Science and Technology (K-JIST) Puk-Gu Oryong-Dong

More information

CSCD01 Engineering Large Software Systems. Design Patterns. Joe Bettridge. Winter With thanks to Anya Tafliovich

CSCD01 Engineering Large Software Systems. Design Patterns. Joe Bettridge. Winter With thanks to Anya Tafliovich CSCD01 Engineering Large Software Systems Design Patterns Joe Bettridge Winter 2018 With thanks to Anya Tafliovich Design Patterns Design patterns take the problems consistently found in software, and

More information

Pattern-Oriented Development with Rational Rose

Pattern-Oriented Development with Rational Rose Pattern-Oriented Development with Rational Rose Professor Peter Forbrig, Department of Computer Science, University of Rostock, Germany; Dr. Ralf Laemmel, Department of Information Management and Software

More information

The University of Texas at Arlington

The University of Texas at Arlington The University of Texas at Arlington Lecture 10: Threading and Parallel Programming Constraints CSE 5343/4342 Embedded d Systems II Objectives: Lab 3: Windows Threads (win32 threading API) Convert serial

More information

Composition and Separation of Concerns in the Object-Oriented Model

Composition and Separation of Concerns in the Object-Oriented Model ACM Computing Surveys 28A(4), December 1996, http://www.acm.org/surveys/1996/. Copyright 1996 by the Association for Computing Machinery, Inc. See the permissions statement below. Composition and Separation

More information

On Preserving Domain Consistency for an Evolving Application

On Preserving Domain Consistency for an Evolving Application On Preserving Domain Consistency for an Evolving Application João Roxo Neves and João Cachopo INESC-ID / Instituto Superior Técnico, Universidade Técnica de Lisboa, Portugal {JoaoRoxoNeves,joao.cachopo}@ist.utl.pt

More information