12.5 Synchronization BY PRIYANKA, HARSHA, JEJI & XIAOLONG ADVISOR- DR.YANQING ZHANG.

Slides:



Advertisements
Similar presentations
Unveiling ProjectWise V8 XM Edition. ProjectWise V8 XM Edition An integrated system of collaboration servers that enable your AEC project teams, your.
Advertisements

TCP/IP Protocol Suite 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 22 World Wide Web and HTTP.
Study of Hurricane and Tornado Operating Systems By Shubhanan Bakre.
Read-Copy Update P. E. McKenney, J. Appavoo, A. Kleen, O. Krieger, R. Russell, D. Saram, M. Soni Ottawa Linux Symposium 2001 Presented by Bogdan Simion.
Mi-Joung choi, Hong-Taek Ju, Hyun-Jun Cha, Sook-Hyang Kim and J
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Threads Clients Servers Code Migration Software Agents Summary
Inter Process Communication:  It is an essential aspect of process management. By allowing processes to communicate with each other: 1.We can synchronize.
ESI Extensions for Web-based Collaboration Introduction to Edge Side Includes: - ESI helps offload the work of web page construction from origin server.
1 CS6320 – Why Servlets? L. Grewe 2 What is a Servlet? Servlets are Java programs that can be run dynamically from a Web Server Servlets are Java programs.
Systems Architecture, Fourth Edition1 Internet and Distributed Application Services Chapter 13.
A. Frank - P. Weisberg Operating Systems Introduction to Tasks/Threads.
PRASHANTHI NARAYAN NETTEM.
Using Two Queues. Using Multiple Queues Suspended Processes Processor is faster than I/O so all processes could be waiting for I/O Processor is faster.
Fundamentals of Python: From First Programs Through Data Structures
Web Client/Server Communication A290/A590, Fall /09/2014.
Christopher M. Pascucci Basic Structural Concepts of.NET Browser – Server Interaction.
INTRODUCTION TO WEB DATABASE PROGRAMMING
Web-based Software Development Web-based Distributed Authoring and Versioning Jul 19, 2005 Shin Young Ahn.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
Copyright © cs-tutorial.com. Introduction to Web Development In 1990 and 1991,Tim Berners-Lee created the World Wide Web at the European Laboratory for.
DATA COMMUNICATION DONE BY: ALVIN SAMPATH CARLVIN SAMPATH.
JavaScript, Fourth Edition Chapter 12 Updating Web Pages with AJAX.
© 2011 Delmar, Cengage Learning Chapter 7 Managing a Web Server and Files.
1 PHP and MySQL. 2 Topics  Querying Data with PHP  User-Driven Querying  Writing Data with PHP and MySQL PHP and MySQL.
5 Chapter Five Web Servers. 5 Chapter Objectives Learn about the Microsoft Personal Web Server Software Learn how to improve Web site performance Learn.
Cosc 4740 Chapter 6, Part 3 Process Synchronization.
Scalable Web Server on Heterogeneous Cluster CHEN Ge.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 3: Operating-System Structures System Components Operating System Services.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Introduction to Concurrency.
1 Welcome to CSC 301 Web Programming Charles Frank.
Operating Systems CSE 411 Multi-processor Operating Systems Multi-processor Operating Systems Dec Lecture 30 Instructor: Bhuvan Urgaonkar.
CE Operating Systems Lecture 3 Overview of OS functions and structure.
Kernel Locking Techniques by Robert Love presented by Scott Price.
World Wide Web “WWW”, "Web" or "W3". World Wide Web “WWW”, "Web" or "W3"
1 WWW. 2 World Wide Web Major application protocol used on the Internet Simple interface Two concepts –Point –Click.
Multithreaded Programing. Outline Overview of threads Threads Multithreaded Models  Many-to-One  One-to-One  Many-to-Many Thread Libraries  Pthread.
GLOBAL EDGE SOFTWERE LTD1 R EMOTE F ILE S HARING - Ardhanareesh Aradhyamath.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 3: Process-Concept.
Department of Computer Science and Software Engineering
The read-copy-update mechanism for supporting real-time applications on shared-memory multiprocessor systems with Linux Guniguntala et al.
Module: Software Engineering of Web Applications Chapter 2: Technologies 1.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
CS510 Concurrent Systems Jonathan Walpole. RCU Usage in Linux.
CS 6401 The World Wide Web Outline Background Structure Protocols.
Lecture 4 Mechanisms & Kernel for NOSs. Mechanisms for Network Operating Systems  Network operating systems provide three basic mechanisms that support.
Threads. Readings r Silberschatz et al : Chapter 4.
Operating Systems (CS 340 D) Dr. Abeer Mahmoud Princess Nora University Faculty of Computer & Information Systems Computer science Department.
Introduction Contain two or more CPU share common memory and peripherals. Provide greater system throughput. Multiple processor executing simultaneous.
TCP/IP Protocol Suite 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 22 World Wide Web and HTTP.
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
DISTRIBUTED FILE SYSTEM- ENHANCEMENT AND FURTHER DEVELOPMENT BY:- PALLAWI(10BIT0033)
12. DISTRIBUTED WEB-BASED SYSTEMS Nov SUSMITHA KOTA KRANTHI KOYA LIANG YI.
DISTRIBUTED SYSTEMS Principles and Paradigms Second Edition ANDREW S
WWW and HTTP King Fahd University of Petroleum & Minerals
Distributed Shared Memory
WEB SERVICES From Chapter 19 of Distributed Systems Concepts and Design,4th Edition, By G. Coulouris, J. Dollimore and T. Kindberg Published by Addison.
Operating Systems (CS 340 D)
Chapter 2: System Structures
Distributed web based systems
Web Caching? Web Caching:.
Viney Sindhu Dr. Yanqing Zhang
Chapter 27 WWW and HTTP.
HyperText Transfer Protocol
Multithreaded Programming
Chapter 2: Operating-System Structures
WEB SERVICES From Chapter 19, Distributed Systems
CSE 451 Section 1/27/2000.
Chapter 2: Operating-System Structures
Presentation transcript:

12.5 Synchronization BY PRIYANKA, HARSHA, JEJI & XIAOLONG ADVISOR- DR.YANQING ZHANG

Outline Introduction WebDAV and implementation RCU Lock Future Work References

Introduction Synchronization is used to maintain uniformity and consistency of data across all the applications and storing devices It ensures same copy/version of data is used in all devices, allowing the data to be accessed or modified from multiple locations

Synchronization  Synchronization has not been an issue in most traditional Web-based Systems for two reasons: 1. Strict Client-Server Organization: Servers never exchanged information with other servers which means there is nothing much to synchronize 2. Web considered as read-mostly system: Updates are done by a Single person or entity => no write conflicts

Contd.. Things are changing because of increasing demand to provide support for collaborative authoring of Web documents Web should support concurrent updates of documents by a group of collaborating users or processes Increase in Web services increases need for servers to synchronize with each other

WebDAV Distributed authoring of Web documents is handled by a separate protocol known as WebDAV WebDAV stands for Web Distributed Authoring and Versioning It provides simple means to lock a shared document and to create, delete, copy and move documents from remote Web servers.

WebDAV Contd..  WebDAV provides two simple locking mechanisms(Write locks) 1. Exclusive write lock: It is assigned to a single client and will prevent any other client from modifying the shared document while it is locked. 2. Shared write lock: It allows multiple clients to simultaneously update the document. Shared write locks are convenient when clients modify different parts of the same document. Clients need to take care to prevent write-write conflict.

Assigning a lock Initially a lock token is passed on to the requesting client The server registers which client currently has the lock token. Whenever the client wants to modify the document, it sends an HTTP post request to the server, along with the lock token. The token shows that the client has write-access to the document, for which reason the server will carry out the request.

WebDAV WebDAV stands for Web Distributed Authoring and Versioning. Web Distributed Authoring and Versioning (WebDAV) is an extension of the Hypertext transfer control protocol(HTTP) that allows clients to perform remote Web content authoring operations. WebDav is a protocol that handles distributed authoring of Web documents.

Contd.. The WebDAV protocol provides a framework for users to create, change and move documents from remote web servers. The most important features of the WebDAV protocol include the maintenance of properties about an author or modification date, namespace management, collections, and overwrite protection

Contd.. Maintenance of properties includes such things as the creation, removal, and querying of file information. Namespace management deals with the ability to copy and move web pages within a server’s namespace. Collections deal with the creation, removal, and listing of various resources. Lastly, overwrite protection handles aspects related to locking of files.

How to Assign a Lock ? Initially a lock token is passed on to the requesting client The server registers which client currently has the lock token. Whenever the client wants to modify the document, it sends an HTTP post request to the server, along with the lock token. The token shows that the client has write-access to the document, for which reason the server will carry out the request.

Contd.. Important design scenario: There is no need to maintain a connection between the client and the server while holding the lock Client can simply disconnect from the server after acquiring the lock and reconnect to the server when sending an HTTP request The server will one way or the other have to reclaim the token in case if a client holding the token is crashed

Problem Suppose if a client holding a lock token crashes then the server will one way or the other have to reclaim the lock. WebDAV does not specify how servers should handle these and similar situations, but leaves that open to specific implementations. The best solution will depend on the type of documents that WebDAV is being used for. The reason for this approach is that there is no general way to solve the problem of orphan process locks in a clean way.

Orphan process Orphan process is where there are process that is running on the segments and there is no corresponding process related to the same gang on the master or other segments. This orphan process can arise when there is query abort, process crash, server / segment crash etc.

WebDAV-Sync The WebDAV-Sync tool is at the same time a command-line tool and an Ant task. It has three parameters: a URL which refers to a WebDAV collection, a local directory and the synchronization direction. The tool keeps the URL in sync with the directory depending on the direction, which can be down, up or bi-directional. The down direction is useful for cases where a lot of random file access will follow. The up direction is rather for updating offline work on the server. It takes only a few seconds to check if a local directory of around a thousand files is in sync with the WebDAV collection. This is important to reduce the overhead in build scripts when only a few files or directories have changed.

Implementation of WebDAV Protocol Common web browsers ◦Provide only limited support for accessing the HTTP methods ◦No support for accessing the header fields directly HTML forms are extended to provide direct access to these protocols Identification of the user interaction type to provide the protocol request Extensions are proposed to the HTML forms to improve the interaction between user and web browser

Implementation of WebDAV Protocol The browser is implemented in Wafe environment Wafe support several libraries like OSF/Motif, XOTcl, SSLeay, LDAP etc. For HTML rendering and parsing, Kino widget is used

Implementation of WebDAV Protocol Cineast ◦Extensible web browser ◦Implemented using OSF/Motif ◦Provides environment for prototyping new client side (server side) Internet technologies ◦Has built-in support for HTML forms

Implementation of WebDAV Protocol XOTcl ◦Object Oriented Scripting Language ◦Extension of Otcl which contains the language support for dynamic aggregations, per-object mixins and design patterns ◦Implements application logic and general networking functionality

Implementation of WebDAV Protocol Requirements for a web-based user interface for WebDAV ◦Requires user input ◦Three types of user requests are need to initiate a protocol request ◦Request URI ◦Identifies the location of the resource addressed by the protocol method ◦Request Header ◦Defines new header files that are necessary to store some parameters ◦Request Body ◦Body is an well formed XML element

Implementation of WebDav Protocol Application: WebDav-based Project Repository A simple web-based collaborative application is used The documents can be shared collaboratively in a controlled way Cineast web browser is used Apache web server with combination of mod_dav module is used To establish secure connection via SSL, cryptographic support from SSLeay toolkit is taken

Implementation of WebDAV Protocol Functionality and Structure Offers uploading and sharing of documents of various groups Consists set of folders Three levels of operations can be performed New functionality of WebDAV is to assign metadata to web documents Users of project repository able to define and query the metadata Using WebDAV methods, which are accessible via HTML forms

Implementation of WebDAV Protocol Implementation The project repository is viewed and accessed by web browser The functionality is accessed from web browser (Cineast) ◦For example, clicking the push buttons Implemented using WebDAV methods WebDAV methods can be accessed within web browser via HTML forms ◦For example, by clicking the push buttons on repository page a HTML form for corresponding WebDAV method with appropriate default value is displayed

Implementation of WebDAV Protocol Implementation Server side scripting can be used to automate the creation of these HTML forms Signing the signature or verifying the digital signature cannot be mapped to WebDAV methods Combining some particular WebDAV methods can over come the above hurdle ◦For example, to sign first retrieve (GET) the document and then upload (PUT) back to repository

How to synchronize the execution of multiple threads of same process ? Spin Locks Semaphors

Spin Locks vs. Semaphores Spin Locks: Busy waits waste CPU cycles. Can use in interrupt context, as does not sleep. Cannot use when code sleeps while holding lock. Use for locks held a short time. Semaphores: Context switch on sleep is expensive. Sleeps, so cannot use in interrupt context. Can use when code sleeps while holding lock. Use for locks that held a long time.

Reads-write lock When a writer is writing the data, all other writers or readers will be blocked until the writer is finished writing. usually constructed on top of mutexes and condition variables, or on top of semaphores. Need access memory atomically, which is related to memory access speed

Read-Copy Update (RCU)  Lock-free synchronization technique -improve rwlock  Allows multiple readers and writers at once.  RCU can only be used when All data structures are dynamically allocated and referenced by pointers. No kernel control path can sleep in critical region protected by RCU.

How does RCU work? 1.Reader set a flag in the RCU lock to inform others that it is using the lock. 2.Writer first inspect whether there exists read flag in the RCU lock. If it does, make a copy of original data, and write this copied data 3.Writer wait for all readers leaving, and then update the original data with the copied data.

How does RCU implement? Reader: rcu_read_lock(); /* disables kernel preemption */ /* Critical region (read only) */ rcu_read_unlock(); Writer: Makes a copy of data structure. Modifies the copy. Switches pointer to point to copy. Deallocates old struct when all readers are done ( when there exist task switching).

What is RCU?  Reader-writer synchronization mechanism Leverages read-mostly nature of many operating-system data structures  Writers use atomic commit points create new versions  Writers incur substantial overhead Writers must synchronize with each other Writers must defer destructive actions until readers are done

RCU Performance Challenges  How can readers signal writers? Atomic instruction? Can reader completion be inferred from existing system state?  How can destruction be deferred without burdening readers? Can costs of destruction be associated with writers and batched to amortize overhead?  How can memory consumption be limited?

How Does RCU Address Overheads?  Lock Contention Readers need not acquire locks: no contention!!! Writers can still suffer lock contention - But only with each other, and writers are infrequent - Very little contention!!!  Memory Latency Readers do not perform memory writes No need to communicate data among CPUs for cache consistency - Memory latency greatly reduced

RCU Research Challenges  Provide efficient RCU implementations Inferring reader signals from existing operations such as context switch Generalize this across multiple OS kernels  Evaluate RCU's performance CPU overhead Scalability Latency

Future work Since the burden of synchronization falls completely on the waiting readers to finish, how to allow concurrently conduct updating for writers is an interesting issue. There is no general way to solve the problem of the orphan process in the WebDAV. In order to prevent the issues caused by the orphan process we can carry out the operations using different protocols like AtomPub, a HTTP based protocol for creating and updating web services.

Reference  P. E. McKenney. Exploiting Deferred Destruction: An Analysis of Read-Copy-Update Techniques in Operating System Kernels. PhD thesis, OGI School of Science and Engineering at Oregon Health and Sciences University, Available:   Dridi, F.; Neumann, G., "How to implement Web-based groupware systems based on WebDAV," in Enabling Technologies: Infrastructure for Collaborative Enterprises, (WET ICE '99) Proceedings. IEEE 8th International Workshops on, vol., no., pp , 1999      Distributed Systems: Principles and Paradigms, Andrew S. Tanenbaum and Maarten Van Steen, (Second Edition)

Thank you !