Paper 3F6: Software Engineering and Systems Distributed Systems Design Solutions to Examples Paper 3

Size: px
Start display at page:

Download "Paper 3F6: Software Engineering and Systems Distributed Systems Design Solutions to Examples Paper 3"

Transcription

1 Engineering Tripos Part IIA THIRD YEAR Paper 3F: Software Engineering and Systems Distributed Systems Design Solutions to Examples Paper 3 CORBA 1. (a) A typical IDL file for this application is as follows: typedef long Money; // amount in pence interface StockBroker Money get_price(in string sharecode); bool buy(in string sharecode, in long numshares); bool sell(in string sharecode, in long numshares); Money get_balance(); The Money typedef defines an alias for a long, which just makes the interface definition more readable, and helps avoid confusion. Alternative solutions could define a Money structure storing pounds and pence, or use pounds as a float. buy and sell need to indicate whether or not they were successful, hence in this answer they return a bool. It would be even better to have them raise exceptions (which are available CORBA, but not covered in the context of CORBA in this course). (b) Naively, these extensions could be implemented by adding two new functions to the existing interface. However, this could break existing software that uses the old interface, so the safest way to provide the extra facilities is to create a derived interface. interface ExtendedStockBroker : StockBroker Money get_avgprice(in string sharecode, in long numdays); float get_pe_ratio(in string sharecode); (c) i. The server has to know the account balance for each customer the number of each type of share held In practice, the server should also probably know something about the identity of each customer and a password or similar to allow customers to verify their identity. 1

2 only one Broker_Factory in the whole system one StockBroker object per client Broker_Factory +get_broker(): StockBroker 1 << instantiate >> StockBroker +get_price(): money +buy(sharecode:string,numshares:int) +sell(sharecode:string,numshares:int) +get_balance(): money 1 Server Client * Trading_Client 1 To begin trading, a Trading_Client first asks the Broker_Factory for a StockBroker object The Broker_Factory creates a StockBroker object and passes a CORBA pointer to this object back to the Trading_Client The Trading_Client can then use this StockBroker object for trading This way, each Trading_Client has its own personal StockBroker object in the server Figure 1: (Question 1(c)) The stock broker application showing the factory ii. CORBA factories are objects which create objects of some other type. In this case, a BrokerFactory could be used to create StockBroker objects (or ExtendedStockBroker objects) for each customer. interface BrokerFactory StockBroker get_broker(in string userid); This IDL allows each user to obtain their own StockBroker from the BrokerFactory. This means that each StockBroker object can store the per customer information for the individual customer that it serves. The get_broker function is interesting because instead of returning a data value (e.g. a long), it returns a pointer to another CORBA object. The client can use this return value to access the newly created StockBroker object and call the methods provided in its interface. A UML class diagram for the system is shown in Figure (a) The idl file has to support downloading of four types of object. Each of the media objects are identified by a code number, stored in the associated hotpoint. interface TourismServer Model get_model(); Image get_image(in long imageno); Movie get_movie(in long movieno); 2

3 SoundClip get_soundclip(in long clipno); (b) The simplest way to do this is just to supply an argument to the get_model method to identify the zone to be downloaded, which becomes Model get_zone(in long zone); For an alternative (and more general) approach see part (c). (c) An alternative approach to answering the above question and a method which can be used to host zones on other servers is to create a Zone object, one per zone. Each Zone object is then responsible for handling the downloading of its model, images, movies and soundclips. The client could keep going back to the TourismServer for each new Zone pointer, but a better solution would be to embed the Zone CORBA pointers directly into the Model data, so that the client can link to them directly. All the TourismServer then has to do is provide a pointer to the first Zone object. This new idl file would then look like: interface Zone Model get_model(); Image get_image(in long imageno); Movie get_movie(in long movieno); SoundClip get_soundclip(in long clipno); interface TourismServer Zone get_first_zone(); (d) In order to do this load balancing, the pointers contained in the models must be separated from the actual Zone objects that will supply the downloading. The simplest way to do this is to introduce an intermediate object: interface ZoneFactory Zone get_zone(); The Model data will now contain pointers to ZoneFactorys (there is a separate ZoneFactory per zone). The ZoneFactory object can perform the load balancing when a client uses its get_zone method by determining which of the server s computers is the least heavily loaded and returning a pointer to a Zone object created on that computer, which is used as in part (c). (e) In order for users to see each other moving within the world, two things need to happen: Users need to let the server know about their movements in the world. This could be achieved by adding a move_to method to the Zone object 3

4 interface Zone void move_to(in string userid, in long x, in long y); Users need to find out about the movements of other users. This can be achieved in one of two ways; either the user requests the information from the server (client pull), or the server automatically notifies the user (server push). Using the client pull technique, this could be achieved using the following interface: struct User string userid; long xpos; long ypos; typedef sequence<user> UserList; interface Zone UserList get_users(); Using the server push technique is a little more complicated. In order to do this, each client program has to become a server also (since it is going to provide a method which will be called by the Zone object). This means that the client programs will need an interface: interface ZoneClient void notify(in UserList users); Also the clients will have to provide a pointer to their ZoneClient object when moving within a zone (in place of their userid): interface Zone void move_to(in ZoneClient clientptr, in long x, in long y); To allow users to send text messages to each other requires an additional method on the Zone object: interface Zone void send_message(in string userid, in string message); The users then have to be able to obtain messages either by client pull: 4

5 interface Zone string get_message(in string userid); or server push: interface ZoneClient void deliver_message(in string message); Database Systems 3. (a) Pessimism and optimism are two extremes of transactional concurrency control policy. The main difference between optimism and pessimism with reference to the ACID properties is isolation. Pessimistic policies exhibit strict isolation using locking systems. This means that no transaction can access an object that has had a write operation performed on it until the transaction that performed the write operation has committed. More optimistic policies allow other transactions to perform operations on objects before a previous invoker has committed. If a potential conflict is subsequently detected then all of the transactions involved are aborted. The difference is a tradeoff between efficiency and the likelihood of an abort. If simultaneous access to an object is unlikely, then optimistic strategies will be more efficient. Alternatively, if simultaneous access is frequent, then pessimistic strict locking will probably be better although note that dead-lock is more likely with pessimistic schemes. The locking mechanism itself carries an overhead, hence optimistic strategies are also preferred for cases where data is read frequently but updated very rarely. (b) i. A pessimistic policy would be more efficient since there can be a large number of potential concurrent accesses associated with a flight booking system (e.g. when a large group of people need to book on the same flight). ii. An optimistic policy would lead to a more efficient implementation since it is likely that updates will be reasonably infrequent but many concurrent reads may occur when several interested parties review a case. iii. An optimistic policy would be more efficient. The assumptions above about criminals hold for patients. Also, it is important to be able to get a potentially life-saving information quickly and optimistic methods do not delay at transaction startup since they never have to wait for locks. 4. (a) When a transaction T x issues a Q.read, then a lock Q.S must be requested. If the lock is granted then it should be drawn as pointing to 5

6 T x (see T 4 in the given graph). When multiple reads are requested on the same account Q, then Q.S should point to each transaction (see T 2 and T 3 both reading F in the graph). When an exclusive lock Q.X is requested, then Q.S may or may not be already allocated to T x. If it is not, it should be implicitly allocated. In either case, the exclusive lock Q.X should point to Q.S which in turn points to the transaction to which it is allocated (see E.X in the graph). All of the above assumes that requested locks are granted. As explained in the lectures, a read request will block if some other transaction has exclusive access. A write will also block if some other process has shared or exclusive access. This occurs at step 10 when T 5 request a write on account A. In this case, a dotted arrow is inserted between T 5 and A.X to show that T 5 is blocked waiting to aquire A.X. (b) the graphs following steps 12, 20, 25, and 35 are shown below. When a transaction commits or aborts, all of the locks allocated to it are released (note for these purposes the effects of Commit and abort are identical). T C.S A.S 15 C.X T T C.S A.S 15 C.X T5 T4 T2 T A.S D.S B.S E.S F.S T A.X E.X T4 T2 T3 T T T D.S B.S E.S F.S G.S 20 H.S 1 E.X G.X T4 T2 4 2 T3 8 T T D.S B.S E.S F.S G.S 25 H.S 1 25 E.X G.X H.X a) Resource graph after step 12 b) Resource graph after step 20 c) Resource graph after step 25 Figure 2: (Question 4(b)) (c) A deadlock is indicated in a graph if there is a cycle of dependencies. Activity upto step 25 yields simple graphs with no loops. The final graph however shows a number of transactions waiting on locks, and there is a loop involving T 2, T 3, T 8 and T. These transactions are therefore dead-locked. T 4 depends on T, T 12 depends on T 4 and both T 10 and T 11 depend on T 12, so all of these transactions are also stalled by the deadlock. Concurrent Systems 5. (a) This solution fails to provide mutual exclusion. This can be seen by considering a likely sequence of instructions when the program first starts:

7 T C.S 31 C.X 2 T D.S 34 D.X 32 T3 8 F.S F.X 24 T10 A.S A.X T4 H.X 35 G.X G.S T H.S 23 1 T8 B.S 2 20 E.S T2 30 E.X d) Resource graph after step 35 Figure 3: (Question 4(b and c)) thread1 finds c2 is true thread2 finds c1 is true thread1 sets c1 false thread2 sets c2 false thread1 executes its critical section thread2 executes its critical section (b) The problem in the previous example is that each thread tests the other s so-called claim variable before setting its own. The suggested reordering of the instructions solves this problem and therefore may be expected to provide mutual exclusion (in fact it can be proved that it does). Unfortunately it deadlocks and is therefore also no use. This can be shown by considering the sequence thread1 sets c1 false thread2 sets c2 false thread1 finds c2 is false and remains in the spinlock forever thread2 finds c1 is false and remains in the spinlock forever. A solution is shown below. Important points to note in the solution are: secure the semaphore for each fork before using it, to ensure mutual exclusion each of the fork semaphores is initialised to 1

8 the semaphore room is initialised to 4 to make sure that at most 4 philosophers can be in the room at any instant of time. Without this, if five philosophers were allowed in at the same, deadlock could occur with each philosopher having one fork and all waiting for the second. (NB. A trivial solution would be to initialise the room semaphore to 1. This would satisfy the requirements given in the question, but is not an efficient solution as most of the forks would be sitting unused.) semaphore sfork[5]; // Initialised in main() semaphore sroom; // Initialised in main() void philosopher(int ID) while(true) think(); secure(sroom); secure(sfork[id % 5]; secure(sfork[(id + 1) % 5]); eat(); release(sfork[id % 5]; release(sfork[(id + 1) % 5]); release(sroom); int main() // Initialise the semaphores sroom = 4; for(int i = 0; i < 4; i++) sfork[i] = 1; // Start the philosophers for(int i=1; i < 5; i++) fork(philosopher(i));. The solution to this problem requires that the wrapper object maintains a count of the number of nested calls and also records the identity of the caller who currently holds the semaphore. Also, a second semaphore is needed to protect the extended classes critical sections. Thus, the new class definition might be class semaphorex public: void enter(); void leave(); private: semaphore sx; semaphore mutex; int count; // the semaphore being extended // to control access to this class // count nested calls 8

9 thread * caller; // pointer to calling thread Possible implementations of the enter and leave methods are semaphorex::enter() mutex.enter(); if (caller == CallingThread()) ++count; // nested call to enter else mutex.leave(); sx.enter(); mutex.enter(); count=1; caller = CallingThread(); mutex.leave(); // acquire the real semaphore semaphorex::leave() mutex.enter(); if (caller == CallingThread()) --count; // nested call to leave critical section if (count==0) sx.leave(); // final exit caller = NULL; else raise error; // too many leave calls mutex.leave(); Steve Young February 2008

(Pessimistic) Timestamp Ordering. Rules for read and write Operations. Pessimistic Timestamp Ordering. Write Operations and Timestamps

(Pessimistic) Timestamp Ordering. Rules for read and write Operations. Pessimistic Timestamp Ordering. Write Operations and Timestamps (Pessimistic) stamp Ordering Another approach to concurrency control: Assign a timestamp ts(t) to transaction T at the moment it starts Using Lamport's timestamps: total order is given. In distributed

More information

Mutual Exclusion using Monitors

Mutual Exclusion using Monitors Mutual Exclusion using Monitors Some programming languages, such as Concurrent Pascal, Modula-2 and Java provide mutual exclusion facilities called monitors. They are similar to modules in languages that

More information

Overview Motivating Examples Interleaving Model Semantics of Correctness Testing, Debugging, and Verification

Overview Motivating Examples Interleaving Model Semantics of Correctness Testing, Debugging, and Verification Introduction Overview Motivating Examples Interleaving Model Semantics of Correctness Testing, Debugging, and Verification Advanced Topics in Software Engineering 1 Concurrent Programs Characterized by

More information

Concepts of Concurrent Computation

Concepts of Concurrent Computation Chair of Software Engineering Concepts of Concurrent Computation Bertrand Meyer Sebastian Nanz Lecture 3: Synchronization Algorithms Today's lecture In this lecture you will learn about: the mutual exclusion

More information

Monitors, Java, Threads and Processes

Monitors, Java, Threads and Processes Monitors, Java, Threads and Processes 185 An object-oriented view of shared memory A semaphore can be seen as a shared object accessible through two methods: wait and signal. The idea behind the concept

More information

SOFT 437. Software Performance Analysis. Ch 5:Web Applications and Other Distributed Systems

SOFT 437. Software Performance Analysis. Ch 5:Web Applications and Other Distributed Systems SOFT 437 Software Performance Analysis Ch 5:Web Applications and Other Distributed Systems Outline Overview of Web applications, distributed object technologies, and the important considerations for SPE

More information

Goals. Managing Multi-User Databases. Database Administration. DBA Tasks. (Kroenke, Chapter 9) Database Administration. Concurrency Control

Goals. Managing Multi-User Databases. Database Administration. DBA Tasks. (Kroenke, Chapter 9) Database Administration. Concurrency Control Goals Managing Multi-User Databases Database Administration Concurrency Control (Kroenke, Chapter 9) 1 Kroenke, Database Processing 2 Database Administration All large and small databases need database

More information

An Implementation Of Multiprocessor Linux

An Implementation Of Multiprocessor Linux An Implementation Of Multiprocessor Linux This document describes the implementation of a simple SMP Linux kernel extension and how to use this to develop SMP Linux kernels for architectures other than

More information

Last Class: Semaphores

Last Class: Semaphores Last Class: Semaphores A semaphore S supports two atomic operations: S Wait(): get a semaphore, wait if busy semaphore S is available. S Signal(): release the semaphore, wake up a process if one is waiting

More information

Introduction Object-Oriented Network Programming CORBA addresses two challenges of developing distributed systems: 1. Making distributed application development no more dicult than developing centralized

More information

PostgreSQL Concurrency Issues

PostgreSQL Concurrency Issues PostgreSQL Concurrency Issues 1 PostgreSQL Concurrency Issues Tom Lane Red Hat Database Group Red Hat, Inc. PostgreSQL Concurrency Issues 2 Introduction What I want to tell you about today: How PostgreSQL

More information

Interpreters and virtual machines. Interpreters. Interpreters. Why interpreters? Tree-based interpreters. Text-based interpreters

Interpreters and virtual machines. Interpreters. Interpreters. Why interpreters? Tree-based interpreters. Text-based interpreters Interpreters and virtual machines Michel Schinz 2007 03 23 Interpreters Interpreters Why interpreters? An interpreter is a program that executes another program, represented as some kind of data-structure.

More information

Transactions and Concurrency Control. Goals. Database Administration. (Manga Guide to DB, Chapter 5, pg 125-137, 153-160) Database Administration

Transactions and Concurrency Control. Goals. Database Administration. (Manga Guide to DB, Chapter 5, pg 125-137, 153-160) Database Administration Transactions and Concurrency Control (Manga Guide to DB, Chapter 5, pg 125-137, 153-160) 1 Goals Database Administration Concurrency Control 2 Database Administration All large and small databases need

More information

MPLAB Harmony System Service Libraries Help

MPLAB Harmony System Service Libraries Help MPLAB Harmony System Service Libraries Help MPLAB Harmony Integrated Software Framework v1.08 All rights reserved. This section provides descriptions of the System Service libraries that are available

More information

3 - Lift with Monitors

3 - Lift with Monitors 3 - Lift with Monitors TSEA81 - Computer Engineering and Real-time Systems This document is released - 2015-11-24 version 1.4 Author - Ola Dahl, Andreas Ehliar Assignment - 3 - Lift with Monitors Introduction

More information

Moving from CS 61A Scheme to CS 61B Java

Moving from CS 61A Scheme to CS 61B Java Moving from CS 61A Scheme to CS 61B Java Introduction Java is an object-oriented language. This document describes some of the differences between object-oriented programming in Scheme (which we hope you

More information

Concurrency Control. Chapter 17. Comp 521 Files and Databases Fall 2010 1

Concurrency Control. Chapter 17. Comp 521 Files and Databases Fall 2010 1 Concurrency Control Chapter 17 Comp 521 Files and Databases Fall 2010 1 Conflict Serializable Schedules Recall conflicts (WR, RW, WW) were the cause of sequential inconsistency Two schedules are conflict

More information

Outline of this lecture G52CON: Concepts of Concurrency

Outline of this lecture G52CON: Concepts of Concurrency Outline of this lecture G52CON: Concepts of Concurrency Lecture 10 Synchronisation in Java Natasha Alechina School of Computer Science [email protected] mutual exclusion in Java condition synchronisation

More information

OPERATING SYSTEMS PROCESS SYNCHRONIZATION

OPERATING SYSTEMS PROCESS SYNCHRONIZATION OPERATING SYSTEMS PROCESS Jerry Breecher 6: Process Synchronization 1 OPERATING SYSTEM Synchronization What Is In This Chapter? This is about getting processes to coordinate with each other. How do processes

More information

Rolle s Theorem. q( x) = 1

Rolle s Theorem. q( x) = 1 Lecture 1 :The Mean Value Theorem We know that constant functions have derivative zero. Is it possible for a more complicated function to have derivative zero? In this section we will answer this question

More information

Multiprocessor Scheduling and Scheduling in Linux Kernel 2.6

Multiprocessor Scheduling and Scheduling in Linux Kernel 2.6 Multiprocessor Scheduling and Scheduling in Linux Kernel 2.6 Winter Term 2008 / 2009 Jun.-Prof. Dr. André Brinkmann [email protected] Universität Paderborn PC² Agenda Multiprocessor and

More information

SMTP-32 Library. Simple Mail Transfer Protocol Dynamic Link Library for Microsoft Windows. Version 5.2

SMTP-32 Library. Simple Mail Transfer Protocol Dynamic Link Library for Microsoft Windows. Version 5.2 SMTP-32 Library Simple Mail Transfer Protocol Dynamic Link Library for Microsoft Windows Version 5.2 Copyright 1994-2003 by Distinct Corporation All rights reserved Table of Contents 1 Overview... 5 1.1

More information

BSc (Hons) Business Information Systems, BSc (Hons) Computer Science with Network Security. & BSc. (Hons.) Software Engineering

BSc (Hons) Business Information Systems, BSc (Hons) Computer Science with Network Security. & BSc. (Hons.) Software Engineering BSc (Hons) Business Information Systems, BSc (Hons) Computer Science with Network Security & BSc. (Hons.) Software Engineering Cohort: BIS/05/FT BCNS/05/FT BSE/05/FT Examinations for 2005-2006 / Semester

More information

Lecture 7: Concurrency control. Rasmus Pagh

Lecture 7: Concurrency control. Rasmus Pagh Lecture 7: Concurrency control Rasmus Pagh 1 Today s lecture Concurrency control basics Conflicts and serializability Locking Isolation levels in SQL Optimistic concurrency control Transaction tuning Transaction

More information

CPS122 Lecture: State and Activity Diagrams in UML

CPS122 Lecture: State and Activity Diagrams in UML CPS122 Lecture: State and Activity Diagrams in UML Objectives: last revised February 14, 2012 1. To show how to create and read State Diagrams 2. To introduce UML Activity Diagrams Materials: 1. Demonstration

More information

Monitor Object. An Object Behavioral Pattern for Concurrent Programming. Douglas C. Schmidt

Monitor Object. An Object Behavioral Pattern for Concurrent Programming. Douglas C. Schmidt Monitor Object An Object Behavioral Pattern for Concurrent Programming Douglas C. Schmidt [email protected] Department of Computer Science Washington University, St. Louis 1 Intent The Monitor Object

More information

Lecture 6: Introduction to Monitors and Semaphores

Lecture 6: Introduction to Monitors and Semaphores Concurrent Programming 19530-V (WS01) Lecture 6: Introduction to Monitors and Semaphores Dr. Richard S. Hall [email protected] Concurrent programming November 27, 2001 Abstracting Locking Details

More information

Lecture 12 Doubly Linked Lists (with Recursion)

Lecture 12 Doubly Linked Lists (with Recursion) Lecture 12 Doubly Linked Lists (with Recursion) In this lecture Introduction to Doubly linked lists What is recursion? Designing a node of a DLL Recursion and Linked Lists o Finding a node in a LL (recursively)

More information

Design Patterns in C++

Design Patterns in C++ Design Patterns in C++ Concurrency Patterns Giuseppe Lipari http://retis.sssup.it/~lipari Scuola Superiore Sant Anna Pisa May 4, 2011 G. Lipari (Scuola Superiore Sant Anna) Concurrency Patterns May 4,

More information

3F6 - Software Engineering and Design. Handout 10 Distributed Systems I With Markup. Steve Young

3F6 - Software Engineering and Design. Handout 10 Distributed Systems I With Markup. Steve Young 3F6 - Software Engineering and Design Handout 10 Distributed Systems I With Markup Steve Young Contents 1. Distributed systems 2. Client-server architecture 3. CORBA 4. Interface Definition Language (IDL)

More information

CORBAservices. Naming. Part of the CORBA Naming Service Interface in IDL. CORBA Naming Service

CORBAservices. Naming. Part of the CORBA Naming Service Interface in IDL. CORBA Naming Service CORBAservices CORBAservices are general purpose and application independent services. They resemble and enhance services commonly provided by an operating system: Service Collection Query Concurrency Transaction

More information

Data Management in the Cloud

Data Management in the Cloud Data Management in the Cloud Ryan Stern [email protected] : Advanced Topics in Distributed Systems Department of Computer Science Colorado State University Outline Today Microsoft Cloud SQL Server

More information

Shared Address Space Computing: Programming

Shared Address Space Computing: Programming Shared Address Space Computing: Programming Alistair Rendell See Chapter 6 or Lin and Synder, Chapter 7 of Grama, Gupta, Karypis and Kumar, and Chapter 8 of Wilkinson and Allen Fork/Join Programming Model

More information

Lecture 10: Dynamic Memory Allocation 1: Into the jaws of malloc()

Lecture 10: Dynamic Memory Allocation 1: Into the jaws of malloc() CS61: Systems Programming and Machine Organization Harvard University, Fall 2009 Lecture 10: Dynamic Memory Allocation 1: Into the jaws of malloc() Prof. Matt Welsh October 6, 2009 Topics for today Dynamic

More information

Lecture 6: Semaphores and Monitors

Lecture 6: Semaphores and Monitors HW 2 Due Tuesday 10/18 Lecture 6: Semaphores and Monitors CSE 120: Principles of Operating Systems Alex C. Snoeren Higher-Level Synchronization We looked at using locks to provide mutual exclusion Locks

More information

Jorix kernel: real-time scheduling

Jorix kernel: real-time scheduling Jorix kernel: real-time scheduling Joris Huizer Kwie Min Wong May 16, 2007 1 Introduction As a specialized part of the kernel, we implemented two real-time scheduling algorithms: RM (rate monotonic) and

More information

OMPT and OMPD: OpenMP Tools Application Programming Interfaces for Performance Analysis and Debugging

OMPT and OMPD: OpenMP Tools Application Programming Interfaces for Performance Analysis and Debugging OMPT and OMPD: OpenMP Tools Application Programming Interfaces for Performance Analysis and Debugging Alexandre Eichenberger, John Mellor-Crummey, Martin Schulz, Nawal Copty, John DelSignore, Robert Dietrich,

More information

1 An application in BPC: a Web-Server

1 An application in BPC: a Web-Server 1 An application in BPC: a Web-Server We briefly describe our web-server case-study, dwelling in particular on some of the more advanced features of the BPC framework, such as timeouts, parametrized events,

More information

Lightweight Locking for Main Memory Database Systems

Lightweight Locking for Main Memory Database Systems Lightweight Locking for Main Memory Database Systems Kun Ren * [email protected] Alexander Thomson * [email protected] Daniel J. Abadi * [email protected] Northwestern Polytechnical University, China * Yale

More information

3C03 Concurrency: Condition Synchronisation

3C03 Concurrency: Condition Synchronisation 3C03 Concurrency: Condition Synchronisation Mark Handley 1 Goals n Introduce concepts of Condition synchronisation Fairness Starvation n Modelling: Relationship between guarded actions and condition synchronisation?

More information

Systemnahe Programmierung KU

Systemnahe Programmierung KU S C I E N C E P A S S I O N T E C H N O L O G Y Systemnahe Programmierung KU A6,A7 www.iaik.tugraz.at 1. Virtual Memory 2. A7 - Fast-Food Restaurant 2 Course Overview A8, A9 System Programming A7 Thread

More information

1.5. Factorisation. Introduction. Prerequisites. Learning Outcomes. Learning Style

1.5. Factorisation. Introduction. Prerequisites. Learning Outcomes. Learning Style Factorisation 1.5 Introduction In Block 4 we showed the way in which brackets were removed from algebraic expressions. Factorisation, which can be considered as the reverse of this process, is dealt with

More information

Lecture 9 verifying temporal logic

Lecture 9 verifying temporal logic Basics of advanced software systems Lecture 9 verifying temporal logic formulae with SPIN 21/01/2013 1 Outline for today 1. Introduction: motivations for formal methods, use in industry 2. Developing models

More information

Linux Driver Devices. Why, When, Which, How?

Linux Driver Devices. Why, When, Which, How? Bertrand Mermet Sylvain Ract Linux Driver Devices. Why, When, Which, How? Since its creation in the early 1990 s Linux has been installed on millions of computers or embedded systems. These systems may

More information

CS4410 - Fall 2008 Homework 2 Solution Due September 23, 11:59PM

CS4410 - Fall 2008 Homework 2 Solution Due September 23, 11:59PM CS4410 - Fall 2008 Homework 2 Solution Due September 23, 11:59PM Q1. Explain what goes wrong in the following version of Dekker s Algorithm: CSEnter(int i) inside[i] = true; while(inside[j]) inside[i]

More information

Database Concurrency Control and Recovery. Simple database model

Database Concurrency Control and Recovery. Simple database model Database Concurrency Control and Recovery Pessimistic concurrency control Two-phase locking (2PL) and Strict 2PL Timestamp ordering (TSO) and Strict TSO Optimistic concurrency control (OCC) definition

More information

Section 3.7. Rolle s Theorem and the Mean Value Theorem. Difference Equations to Differential Equations

Section 3.7. Rolle s Theorem and the Mean Value Theorem. Difference Equations to Differential Equations Difference Equations to Differential Equations Section.7 Rolle s Theorem and the Mean Value Theorem The two theorems which are at the heart of this section draw connections between the instantaneous rate

More information

G(s) = Y (s)/u(s) In this representation, the output is always the Transfer function times the input. Y (s) = G(s)U(s).

G(s) = Y (s)/u(s) In this representation, the output is always the Transfer function times the input. Y (s) = G(s)U(s). Transfer Functions The transfer function of a linear system is the ratio of the Laplace Transform of the output to the Laplace Transform of the input, i.e., Y (s)/u(s). Denoting this ratio by G(s), i.e.,

More information

Why Threads Are A Bad Idea (for most purposes)

Why Threads Are A Bad Idea (for most purposes) Why Threads Are A Bad Idea (for most purposes) John Ousterhout Sun Microsystems Laboratories [email protected] http://www.sunlabs.com/~ouster Introduction Threads: Grew up in OS world (processes).

More information

Distributed Transactions

Distributed Transactions Distributed Transactions 1 Transactions Concept of transactions is strongly related to Mutual Exclusion: Mutual exclusion Shared resources (data, servers,...) are controlled in a way, that not more than

More information

OMPT: OpenMP Tools Application Programming Interfaces for Performance Analysis

OMPT: OpenMP Tools Application Programming Interfaces for Performance Analysis OMPT: OpenMP Tools Application Programming Interfaces for Performance Analysis Alexandre Eichenberger, John Mellor-Crummey, Martin Schulz, Michael Wong, Nawal Copty, John DelSignore, Robert Dietrich, Xu

More information

CHAPTER 2. Logic. 1. Logic Definitions. Notation: Variables are used to represent propositions. The most common variables used are p, q, and r.

CHAPTER 2. Logic. 1. Logic Definitions. Notation: Variables are used to represent propositions. The most common variables used are p, q, and r. CHAPTER 2 Logic 1. Logic Definitions 1.1. Propositions. Definition 1.1.1. A proposition is a declarative sentence that is either true (denoted either T or 1) or false (denoted either F or 0). Notation:

More information

Threads 1. When writing games you need to do more than one thing at once.

Threads 1. When writing games you need to do more than one thing at once. Threads 1 Threads Slide 1 When writing games you need to do more than one thing at once. Threads offer a way of automatically allowing more than one thing to happen at the same time. Java has threads as

More information

Getting Started with the Internet Communications Engine

Getting Started with the Internet Communications Engine Getting Started with the Internet Communications Engine David Vriezen April 7, 2014 Contents 1 Introduction 2 2 About Ice 2 2.1 Proxies................................. 2 3 Setting Up ICE 2 4 Slices 2

More information

NSPK Protocol Security Model Checking System Builder

NSPK Protocol Security Model Checking System Builder , pp.307-316 http://dx.doi.org/10.14257/ijsia.2015.9.7.28 NSPK Protocol Security Model Checking System Builder Wang Yan, Liu Ying Information Engineering College, Zhongzhou University, Zhengzhou 450044;

More information

A Survey of Parallel Processing in Linux

A Survey of Parallel Processing in Linux A Survey of Parallel Processing in Linux Kojiro Akasaka Computer Science Department San Jose State University San Jose, CA 95192 408 924 1000 [email protected] ABSTRACT Any kernel with parallel processing

More information

CS4410 Final Exam : Solution set. while(ticket[k] && (ticket[k],k) < (ticket[i],i))

CS4410 Final Exam : Solution set. while(ticket[k] && (ticket[k],k) < (ticket[i],i)) 1. Bakery Algorithm after optimization: CS4410 Final Exam : Solution set 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 int ticket[n] = 0; boolean choosing[n] = false; void CSEnter(int i) { choosing[i]

More information

Resurrecting Ada s Rendez-Vous in Java

Resurrecting Ada s Rendez-Vous in Java Resurrecting Ada s Rendez-Vous in Java Luis Mateu, José M. Piquer and Juan León DCC - Universidad de Chile Casilla 2777, Santiago, Chile [email protected] Abstract Java is a programming language designed

More information

Database Management System Prof. D. Janakiram Department of Computer Science & Engineering Indian Institute of Technology, Madras Lecture No.

Database Management System Prof. D. Janakiram Department of Computer Science & Engineering Indian Institute of Technology, Madras Lecture No. Database Management System Prof. D. Janakiram Department of Computer Science & Engineering Indian Institute of Technology, Madras Lecture No. 23 Concurrency Control Part -4 In the last lecture, we have

More information

Infrastructure that supports (distributed) componentbased application development

Infrastructure that supports (distributed) componentbased application development Middleware Technologies 1 What is Middleware? Infrastructure that supports (distributed) componentbased application development a.k.a. distributed component platforms mechanisms to enable component communication

More information

Chapter-15 -------------------------------------------- Replication in SQL Server

Chapter-15 -------------------------------------------- Replication in SQL Server Important Terminologies: What is Replication? Replication is the process where data is copied between databases on the same server or different servers connected by LANs, WANs, or the Internet. Microsoft

More information

Operating Systems and Networks

Operating Systems and Networks recap Operating Systems and Networks How OS manages multiple tasks Virtual memory Brief Linux demo Lecture 04: Introduction to OS-part 3 Behzad Bordbar 47 48 Contents Dual mode API to wrap system calls

More information

Introduction CORBA Distributed COM. Sections 9.1 & 9.2. Corba & DCOM. John P. Daigle. Department of Computer Science Georgia State University

Introduction CORBA Distributed COM. Sections 9.1 & 9.2. Corba & DCOM. John P. Daigle. Department of Computer Science Georgia State University Sections 9.1 & 9.2 Corba & DCOM John P. Daigle Department of Computer Science Georgia State University 05.16.06 Outline 1 Introduction 2 CORBA Overview Communication Processes Naming Other Design Concerns

More information

Textbook and References

Textbook and References Transactions Qin Xu 4-323A Life Science Building, Shanghai Jiao Tong University Email: [email protected] Tel: 34204573(O) Webpage: http://cbb.sjtu.edu.cn/~qinxu/ Webpage for DBMS Textbook and References

More information

Assignment # 2: Design Patterns and GUIs

Assignment # 2: Design Patterns and GUIs CSUS COLLEGE OF ENGINEERING AND COMPUTER SCIENCE Department of Computer Science CSc 133 Object-Oriented Computer Graphics Programming Spring 2014 John Clevenger Assignment # 2: Design Patterns and GUIs

More information

Illustration 1: Diagram of program function and data flow

Illustration 1: Diagram of program function and data flow The contract called for creation of a random access database of plumbing shops within the near perimeter of FIU Engineering school. The database features a rating number from 1-10 to offer a guideline

More information

MATLAB as an Automated Execution System

MATLAB as an Automated Execution System MATLAB as an Automated Execution System By Ernest P. Chan, Ph.D. Many traders are familiar with MATLAB as a powerful software platform for backtesting trading strategies. This is especially true for those

More information

CORBA Programming with TAOX11. The C++11 CORBA Implementation

CORBA Programming with TAOX11. The C++11 CORBA Implementation CORBA Programming with TAOX11 The C++11 CORBA Implementation TAOX11: the CORBA Implementation by Remedy IT TAOX11 simplifies development of CORBA based applications IDL to C++11 language mapping is easy

More information

PUTNAM TRAINING POLYNOMIALS. Exercises 1. Find a polynomial with integral coefficients whose zeros include 2 + 5.

PUTNAM TRAINING POLYNOMIALS. Exercises 1. Find a polynomial with integral coefficients whose zeros include 2 + 5. PUTNAM TRAINING POLYNOMIALS (Last updated: November 17, 2015) Remark. This is a list of exercises on polynomials. Miguel A. Lerma Exercises 1. Find a polynomial with integral coefficients whose zeros include

More information

Resource Allocation and Deadlock Resource Allocation and Handling

Resource Allocation and Deadlock Resource Allocation and Handling Resource Allocation and Deadlock Resource Allocation and Deadlock Handling Conditions for Deadlock [Coffman-etal 1971] 4 conditions must hold simultaneously for a deadlock to occur: Mutual exclusion: only

More information

pm4dev, 2015 management for development series Project Schedule Management PROJECT MANAGEMENT FOR DEVELOPMENT ORGANIZATIONS

pm4dev, 2015 management for development series Project Schedule Management PROJECT MANAGEMENT FOR DEVELOPMENT ORGANIZATIONS pm4dev, 2015 management for development series Project Schedule Management PROJECT MANAGEMENT FOR DEVELOPMENT ORGANIZATIONS PROJECT MANAGEMENT FOR DEVELOPMENT ORGANIZATIONS A methodology to manage development

More information

Mathematics for Computer Science/Software Engineering. Notes for the course MSM1F3 Dr. R. A. Wilson

Mathematics for Computer Science/Software Engineering. Notes for the course MSM1F3 Dr. R. A. Wilson Mathematics for Computer Science/Software Engineering Notes for the course MSM1F3 Dr. R. A. Wilson October 1996 Chapter 1 Logic Lecture no. 1. We introduce the concept of a proposition, which is a statement

More information

1 Posix API vs Windows API

1 Posix API vs Windows API 1 Posix API vs Windows API 1.1 File I/O Using the Posix API, to open a file, you use open(filename, flags, more optional flags). If the O CREAT flag is passed, the file will be created if it doesnt exist.

More information

language 1 (source) compiler language 2 (target) Figure 1: Compiling a program

language 1 (source) compiler language 2 (target) Figure 1: Compiling a program CS 2112 Lecture 27 Interpreters, compilers, and the Java Virtual Machine 1 May 2012 Lecturer: Andrew Myers 1 Interpreters vs. compilers There are two strategies for obtaining runnable code from a program

More information

DEVELOPING DATA PROVIDERS FOR NEEDFORTRADE STUDIO PLATFORM DATA PROVIDER TYPES

DEVELOPING DATA PROVIDERS FOR NEEDFORTRADE STUDIO PLATFORM DATA PROVIDER TYPES DEVELOPING DATA PROVIDERS FOR NEEDFORTRADE STUDIO PLATFORM NeedForTrade.com Internal release number: 2.0.2 Public release number: 1.0.1 27-06-2008 To develop data or brokerage provider for NeedForTrade

More information

How To Understand The Theory Of Algebraic Functions

How To Understand The Theory Of Algebraic Functions Homework 4 3.4,. Show that x x cos x x holds for x 0. Solution: Since cos x, multiply all three parts by x > 0, we get: x x cos x x, and since x 0 x x 0 ( x ) = 0, then by Sandwich theorem, we get: x 0

More information

Storage Classes CS 110B - Rule Storage Classes Page 18-1 \handouts\storclas

Storage Classes CS 110B - Rule Storage Classes Page 18-1 \handouts\storclas CS 110B - Rule Storage Classes Page 18-1 Attributes are distinctive features of a variable. Data type, int or double for example, is an attribute. Storage class is another attribute. There are four storage

More information

Scheduling. Anne Banks Pidduck Adapted from John Musser

Scheduling. Anne Banks Pidduck Adapted from John Musser Scheduling Anne Banks Pidduck Adapted from John Musser 1 Today Network Fundamentals Gantt Charts PERT/CPM Techniques 2 WBS Types: Process, product, hybrid Formats: Outline or graphical organization chart

More information

Last Class: OS and Computer Architecture. Last Class: OS and Computer Architecture

Last Class: OS and Computer Architecture. Last Class: OS and Computer Architecture Last Class: OS and Computer Architecture System bus Network card CPU, memory, I/O devices, network card, system bus Lecture 3, page 1 Last Class: OS and Computer Architecture OS Service Protection Interrupts

More information

Design by Contract beyond class modelling

Design by Contract beyond class modelling Design by Contract beyond class modelling Introduction Design by Contract (DbC) or Programming by Contract is an approach to designing software. It says that designers should define precise and verifiable

More information

Introduction to Python

Introduction to Python Caltech/LEAD Summer 2012 Computer Science Lecture 2: July 10, 2012 Introduction to Python The Python shell Outline Python as a calculator Arithmetic expressions Operator precedence Variables and assignment

More information

Tasks Schedule Analysis in RTAI/Linux-GPL

Tasks Schedule Analysis in RTAI/Linux-GPL Tasks Schedule Analysis in RTAI/Linux-GPL Claudio Aciti and Nelson Acosta INTIA - Depto de Computación y Sistemas - Facultad de Ciencias Exactas Universidad Nacional del Centro de la Provincia de Buenos

More information

Operating System Manual. Realtime Communication System for netx. Kernel API Function Reference. www.hilscher.com.

Operating System Manual. Realtime Communication System for netx. Kernel API Function Reference. www.hilscher.com. Operating System Manual Realtime Communication System for netx Kernel API Function Reference Language: English www.hilscher.com rcx - Kernel API Function Reference 2 Copyright Information Copyright 2005-2007

More information

Tail call elimination. Michel Schinz

Tail call elimination. Michel Schinz Tail call elimination Michel Schinz Tail calls and their elimination Loops in functional languages Several functional programming languages do not have an explicit looping statement. Instead, programmers

More information

SYSTEM ecos Embedded Configurable Operating System

SYSTEM ecos Embedded Configurable Operating System BELONGS TO THE CYGNUS SOLUTIONS founded about 1989 initiative connected with an idea of free software ( commercial support for the free software ). Recently merged with RedHat. CYGNUS was also the original

More information

Intrusion Detection via Static Analysis

Intrusion Detection via Static Analysis Intrusion Detection via Static Analysis IEEE Symposium on Security & Privacy 01 David Wagner Drew Dean Presented by Yongjian Hu Outline Introduction Motivation Models Trivial model Callgraph model Abstract

More information

Middleware. Peter Marwedel TU Dortmund, Informatik 12 Germany. technische universität dortmund. fakultät für informatik informatik 12

Middleware. Peter Marwedel TU Dortmund, Informatik 12 Germany. technische universität dortmund. fakultät für informatik informatik 12 Universität Dortmund 12 Middleware Peter Marwedel TU Dortmund, Informatik 12 Germany Graphics: Alexandra Nolte, Gesine Marwedel, 2003 2010 年 11 月 26 日 These slides use Microsoft clip arts. Microsoft copyright

More information

The Document Review Process: Automation of your document review and approval. A White Paper. BP Logix, Inc.

The Document Review Process: Automation of your document review and approval. A White Paper. BP Logix, Inc. The Document Review Process: Automation of your document review and approval A White Paper BP Logix, Inc. The Document Review Process A document encompasses many forms technical documentation, product

More information

An Introduction To Simple Scheduling (Primarily targeted at Arduino Platform)

An Introduction To Simple Scheduling (Primarily targeted at Arduino Platform) An Introduction To Simple Scheduling (Primarily targeted at Arduino Platform) I'm late I'm late For a very important date. No time to say "Hello, Goodbye". I'm late, I'm late, I'm late. (White Rabbit in

More information

Output: 12 18 30 72 90 87. struct treenode{ int data; struct treenode *left, *right; } struct treenode *tree_ptr;

Output: 12 18 30 72 90 87. struct treenode{ int data; struct treenode *left, *right; } struct treenode *tree_ptr; 50 20 70 10 30 69 90 14 35 68 85 98 16 22 60 34 (c) Execute the algorithm shown below using the tree shown above. Show the exact output produced by the algorithm. Assume that the initial call is: prob3(root)

More information

Concurrency Control. Module 6, Lectures 1 and 2

Concurrency Control. Module 6, Lectures 1 and 2 Concurrency Control Module 6, Lectures 1 and 2 The controlling intelligence understands its own nature, and what it does, and whereon it works. -- Marcus Aurelius Antoninus, 121-180 A. D. Database Management

More information

MonitorExplorer: A State Exploration-Based Approach to Testing Java Monitors

MonitorExplorer: A State Exploration-Based Approach to Testing Java Monitors Department of Computer Science and Engineering University of Texas at Arlington Arlington, TX 76019 MonitorExplorer: A State Exploration-Based Approach to Testing Java Monitors Y. Lei, R. Carver, D. Kung,

More information

EXTENDED FILE SYSTEM FOR FMD AND NANO-10 PLC

EXTENDED FILE SYSTEM FOR FMD AND NANO-10 PLC EXTENDED FILE SYSTEM FOR FMD AND NANO-10 PLC Before you begin, please download a sample I-TRiLOGI program that will be referred to throughout this manual from our website: http://www.tri-plc.com/trilogi/extendedfilesystem.zip

More information

SAS, Excel, and the Intranet

SAS, Excel, and the Intranet SAS, Excel, and the Intranet Peter N. Prause, The Hartford, Hartford CT Charles Patridge, The Hartford, Hartford CT Introduction: The Hartford s Corporate Profit Model (CPM) is a SAS based multi-platform

More information

Administration. Instruction scheduling. Modern processors. Examples. Simplified architecture model. CS 412 Introduction to Compilers

Administration. Instruction scheduling. Modern processors. Examples. Simplified architecture model. CS 412 Introduction to Compilers CS 4 Introduction to Compilers ndrew Myers Cornell University dministration Prelim tomorrow evening No class Wednesday P due in days Optional reading: Muchnick 7 Lecture : Instruction scheduling pr 0 Modern

More information

Using the VMRC Plug-In: Startup, Invoking Methods, and Shutdown on page 4

Using the VMRC Plug-In: Startup, Invoking Methods, and Shutdown on page 4 Technical Note Using the VMRC API vcloud Director 1.5 With VMware vcloud Director, you can give users the ability to access virtual machine console functions from your web-based user interface. vcloud

More information