Homework #1 (Spring 2012) Due: Tuesday, February 28, 2012

Similar documents
殷亚凤. Consistency and Replication. Distributed Systems [7]

Distributed Systems Exam 1 Review. Paul Krzyzanowski. Rutgers University. Fall 2016

Distributed Systems. coordination Johan Montelius ID2201. Distributed Systems ID2201

Clock Synchronization. Synchronization. Clock Synchronization Algorithms. Physical Clock Synchronization. Tanenbaum Chapter 6 plus additional papers

Threads. Concurrency. What it is. Lecture Notes Week 2. Figure 1: Multi-Threading. Figure 2: Multi-Threading

DEPARTMENT OF INFORMATION TECHNOLOGY QUESTION BANK. UNIT I PART A (2 marks)

Synchronization. Distributed Systems IT332

Chapter 6 Synchronization

Multiprocessors 2007/2008

Synchronization. Chapter 5

Consistency and Replication

Consistency and Replication 1/62

CSE 5306 Distributed Systems

Consistency and Replication 1/65

Synchronization. Clock Synchronization

Distributed Systems Exam 1 Review Paul Krzyzanowski. Rutgers University. Fall 2016

Performance and Forgiveness. June 23, 2008 Margo Seltzer Harvard University School of Engineering and Applied Sciences

Replication and Consistency. Fall 2010 Jussi Kangasharju

Homework #2 Nathan Balon CIS 578 October 31, 2004

CSE 5306 Distributed Systems. Consistency and Replication

殷亚凤. Synchronization. Distributed Systems [6]

Distributed Systems. Lec 9: Distributed File Systems NFS, AFS. Slide acks: Dave Andersen

Important Lessons. A Distributed Algorithm (2) Today's Lecture - Replication

CSE 124: QUANTIFYING PERFORMANCE AT SCALE AND COURSE REVIEW. George Porter December 6, 2017

CS 3305 Intro to Threads. Lecture 6

Parallelism and Concurrency. Motivation, Challenges, Impact on Software Development CSE 110 Winter 2016

Distributed Systems. Pre-Exam 1 Review. Paul Krzyzanowski. Rutgers University. Fall 2015

Consistency. CS 475, Spring 2018 Concurrent & Distributed Systems

CS 153 Lab4 and 5. Kishore Kumar Pusukuri. Kishore Kumar Pusukuri CS 153 Lab4 and 5

Chapter 4: Distributed Systems: Replication and Consistency. Fall 2013 Jussi Kangasharju

SEGR 550 Distributed Computing. Final Exam, Fall 2011

Proseminar Distributed Systems Summer Semester Paxos algorithm. Stefan Resmerita

Concurrency: Mutual Exclusion and Synchronization

Verteilte Systeme (Distributed Systems)

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

Process Synchronization

CSE 486/586 Distributed Systems

CS 471 Operating Systems. Yue Cheng. George Mason University Fall 2017

CSE 544 Principles of Database Management Systems. Alvin Cheung Fall 2015 Lecture 14 Distributed Transactions

Distributed systems. Lecture 6: distributed transactions, elections, consensus and replication. Malte Schwarzkopf

THE UNIVERSITY OF WESTERN AUSTRALIA SAMPLE EXAM QUESTIONS 2007 WITH SOLUTIONS SCHOOL OF COMPUTER SCIENCE CITS3213 CONCURRENT PROGRAMMING (PART II)

Multi-threaded programming in Java

Process Synchronization. Mehdi Kargahi School of ECE University of Tehran Spring 2008

CSE 451: Operating Systems Winter Lecture 7 Synchronization. Steve Gribble. Synchronization. Threads cooperate in multithreaded programs

PROCESS SYNCHRONIZATION

Concept of a process

Synchronization I. Jo, Heeseung

CMSC 132: Object-Oriented Programming II

DISTRIBUTED MUTEX. EE324 Lecture 11

DISTRIBUTED COMPUTER SYSTEMS

Coordination and Agreement

CSE Traditional Operating Systems deal with typical system software designed to be:

Concurrency: Signaling and Condition Variables

Today CSCI Consistency Protocols. Consistency Protocols. Data Consistency. Instructor: Abhishek Chandra. Implementation of a consistency model

Distributed Systems. 05. Clock Synchronization. Paul Krzyzanowski. Rutgers University. Fall 2017

Example Threads. compile: gcc mythread.cc -o mythread -lpthread What is the output of this program? #include <pthread.h> #include <stdio.

CS 333 Introduction to Operating Systems. Class 3 Threads & Concurrency. Jonathan Walpole Computer Science Portland State University

Concurrency: Mutual Exclusion and

Warm-up question (CS 261 review) What is the primary difference between processes and threads from a developer s perspective?

CS533 Concepts of Operating Systems. Jonathan Walpole

Coordination 1. To do. Mutual exclusion Election algorithms Next time: Global state. q q q

Distributed Synchronization. EECS 591 Farnam Jahanian University of Michigan

Data Replication CS 188 Distributed Systems February 3, 2015

Chapter 6 Synchronization (2)

Process Synchroniztion Mutual Exclusion & Election Algorithms

Silberschatz and Galvin Chapter 18

Operating systems. Lecture 12

CSE 451: Operating Systems Winter Lecture 7 Synchronization. Hank Levy 412 Sieg Hall

CSE 444: Database Internals. Lecture 25 Replication

CS 333 Introduction to Operating Systems. Class 3 Threads & Concurrency. Jonathan Walpole Computer Science Portland State University

Process groups and message ordering

Data-Centric Consistency Models. The general organization of a logical data store, physically distributed and replicated across multiple processes.

Distributed Database Management System UNIT-2. Concurrency Control. Transaction ACID rules. MCA 325, Distributed DBMS And Object Oriented Databases

Integrity in Distributed Databases

CSE 160 Lecture 7. C++11 threads C++11 memory model

Threads. Jinkyu Jeong Computer Systems Laboratory Sungkyunkwan University

Process Management And Synchronization

COP 4225 Advanced Unix Programming. Synchronization. Chi Zhang

Selected Questions. Exam 2 Fall 2006

Synchronization Classic Problems

Third Midterm Exam April 24, 2017 CS162 Operating Systems

Replication. Consistency models. Replica placement Distribution protocols

2017 Paul Krzyzanowski 1

CMSC 714 Lecture 14 Lamport Clocks and Eraser

Process/Thread Synchronization

ECE 7650 Scalable and Secure Internet Services and Architecture ---- A Systems Perspective. Part I: Operating system overview: Processes and threads

Thread and Synchronization

Third Midterm Exam April 24, 2017 CS162 Operating Systems

Event Ordering. Greg Bilodeau CS 5204 November 3, 2009

Dealing with Issues for Interprocess Communication

User Space Multithreading. Computer Science, University of Warwick

RCU in the Linux Kernel: One Decade Later

Synchronization Part 2. REK s adaptation of Claypool s adaptation oftanenbaum s Distributed Systems Chapter 5 and Silberschatz Chapter 17

CS 6400 Lecture 11 Name:

10/17/ Gribble, Lazowska, Levy, Zahorjan 2. 10/17/ Gribble, Lazowska, Levy, Zahorjan 4

Process Synchronization: Semaphores. CSSE 332 Operating Systems Rose-Hulman Institute of Technology

Chapter 7: Process Synchronization!

Distributed Transaction Management 2003

CSC 1600: Chapter 6. Synchronizing Threads. Semaphores " Review: Multi-Threaded Processes"

THE AUSTRALIAN NATIONAL UNIVERSITY Mid-semester Quiz, Second Semester COMP2310 (Concurrent and Distributed Systems)

Transcription:

Name: AndrewID: 15-440 Homework #1 (Spring 2012) Due: Tuesday, February 28, 2012 Communication 1. Consider a sliding window protocol, such as the one we discussed in class. What effect does the window size have upon throughput? Please derive a formula that expresses the maximum throughput (bits/second) of the connection between two systems as a function of the bit rate of the channel, the one-way latency of the channel (seconds), the window size (number of frames), and the frame size (bits). 2. Again consider the window size of a sliding window protocol. What factor(s) influence the appropriate window size? What happens if the window is too small? Too large? 3. Java's RMI considers all parameters, except remote object references to be input parameters. They are passed by copy and not returned. In the context of the Java environment, why is this a necessity? In other words, why can't Java emulate a pass-by-reference as a pass by in-out, as was done in C with RPC? 4. In Java objects are very straight-forward to decompose and reconstruct..class files provide blueprints for each type of object, and Java has rich functionality for extracting the properties of an object, including all of its state. As a result, it would seem that the serialization of an object for use as a parameter or return value would require nothing from the object, itself. But, it doesn't work this way. Java's RMI can only send Serializable objects as parameters or return values. These classes of objects implement their own serialization methods. Assume that.class files could be sent to a client, as needed, via HTTP, as is done with stubs. Why doesn't the Java RMI just parse the objects, flatten the fields, and serialize the objects automatically? In your discussion, you should include at least one example of a problematic type of object.

Time 5. Assume that the real-time clocks within some population of N workstations can drift, at most, 10 seconds per day. Consider the task of synchronizing these clocks, to within 0.01 seconds of each other, using each of Cristian's Algorithm and The Berkeley Algorithm. How many messages are required for each approach? 6. In class we discussed using a host id, such as IP address, to break ties and impose a total ordering on Lamport time stamps. This approach, on its face, is unfair. Some hosts are more likely to win than others. We could alleviate this unfairness by randomly choosing between two concurrent events. a) Consider the voting districts algorithm. What problem could arise if two nodes ordered two concurrent events differently? Explain how this could occur. b) How could you ensure that every node in the system agrees on this randomly chosen ordering of concurrent events? (i.e. what would the clocks need to do) c) What are the advantages of giving up fairness? d) Which approach do you like better? Why? 7. In class we discussed vector timestamps as a tool for detecting causality violations, but we didn't discuss certain trade-offs present in the design of the approach. The algorithm that we discussed in class sends the full vector of timestamps with each message. This can be wasteful if the sending processor has received very few messages since the last time it sent a message to the same host. In this case, most (if not all) of the entries remain unchanged. A protocol can be designed that reduces the size of the vector timestamp by sending fewer of these uninteresting entries, but this savings comes at the expense of overhead, including storage and processing, on each host. Please assume that the hosts have plenty of processing power and O(P) space available to store state information related to the timestamp protocol. Operating under these assumptions, design an algorithm for compressed vector timestamps that reduces the size of the vector timestamps as much as possible, without affecting the utility of the time-stamping. Please describe the resulting approach.

Mutual Exclusion 8. Fix the code below so that the numbers print in order, using simple mutexes or counting semaphores: #include <pthread.h> #include <stdio.h> void* thread_one (void* args){ printf("1"); printf("5"); return NULL; void* thread_two (void* args){ printf("2"); printf("4"); return NULL; int main(){ pthread_t tid_one; pthread_t tid_two; pthread_create(&tid_one, NULL, thread_one, NULL); pthread_create(&tid_two, NULL, thread_two, NULL); printf("3"); pthread_join(tid_one, NULL); pthread_join(tid_two, NULL); printf("6\n"); 9. In class, we discussed several techniques for enforcing mutual exclusion. But, we didn't discuss techniques for enforcing other concurrency control policies. Please adapt the majority vote scheme to solve the "at most n users" mutual exclusion problem. In other words, please adapt it so that it allows not more than "n" users to access the shared resource at a time. Your new design should be as loyal to the original design as is practical. If it does not make sense to use an adaptation of the voting scheme for this purpose, please explain the reason.

10. In class, we discussed several techniques for enforcing mutual exclusion. But, we didn't discuss techniques for enforcing other concurrency control policies. Please select one among the mutual exclusion protocols from our in class discussion and adapt it to enforce reader-writer locks, instead of mutual exclusion. Needless to say, you should select a protocol which can be usefully adapted for this purpose. Your new protocol should be as loyal to the original as is practical. A read-writer lock allows readers to share an object with other readers, but ensures that a writer excludes both other writers and also readers. Sometimes this protocol is described as "Shared reads, exclusive writes". Readers should starve writers. 11. What are the relative costs and benefits of mutual exclusion by voting and mutual exclusion by token ring? 12. What do you believe is the Best distributed mutual exclusion algorithm, balancing the message-passing cost and robustness. Why? What are its relative costs and benefits as compared to a central approach? Replication 13. Consider the quorum-based protocols that we discussed in class. Each of these protocols requires some type of read-write locking to ensure that the client is playing with the same version of the object at each of the participating replicas. Without this, two writes could interleave or a read and a write could interleave. Please describe an efficient locking protocol to address these concerns. Assume that the client can interact with all servers, except in the event of failure. 14. Consider a system with N replicas, a read quorum of R, and a write quorum of W. How much failure can this system endure? Please express your answer in terms of N, R, and W. 15. Consider the quorum-based replication algorithms we discussed in class. What quorum policy or policies guarantee that all versions read will be the same and the most up-to date? Why?

16. Consider the use of physical timestamps and version numbers for consistency control in replication. What are the costs and benefits of each technique. Please specifically the bounds that each technique is able to place on the freshness of the object received by any one client, the consistency of the objects as simultaneously viewed by multiple clients, and the message-passing costs of each technique.