Processes.

Slides:



Advertisements
Similar presentations
CS-495 Distributed Systems Fabián E. Bustamante, Winter 2004 Processes Threads & OS Threads in distributed systems Object servers Code migration Software.
Advertisements

Chapter 4 Threads Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and Design Principles, 6/E William.
Threads, SMP, and Microkernels
Processes: Code Migration Chapter 3 Will Cameron CSC 8530 Dr. Schragger.
Threads, SMP, and Microkernels Chapter 4. Process Resource ownership - process is allocated a virtual address space to hold the process image Scheduling/execution-
Chapter 4 Threads, SMP, and Microkernels Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and Design.
Chapter 4: Multithreaded Programming
Threads Irfan Khan Myo Thein What Are Threads ? a light, fine, string like length of material made up of two or more fibers or strands of spun cotton,
Chapter 4: Threads. Overview Multithreading Models Threading Issues Pthreads Windows XP Threads.
Threads. Announcements Cooperating Processes Last time we discussed how processes can be independent or work cooperatively Cooperating processes can.
Describe the concept of lightweight process (LWP) and the advantages to using LWPs Lightweight process (LWP) lies in a hybrid form of user-level & kernel-level.
Computer Science Lecture 6, page 1 CS677: Distributed OS Processes and Threads Processes and their scheduling Multiprocessor scheduling Threads Distributed.
1 DISTRIBUTED SYSTEMS Principles and Paradigms Second Edition ANDREW S. TANENBAUM MAARTEN VAN STEEN Chapter 3 Processes Skip
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
EECS122 - UCB 1 CS 194: Distributed Systems Processes, Threads, Code Migration Computer Science Division Department of Electrical Engineering and Computer.
3.5 Interprocess Communication Many operating systems provide mechanisms for interprocess communication (IPC) –Processes must communicate with one another.
3.5 Interprocess Communication
Processes After today’s lecture, you are asked to know The basic concept of thread and process. What are the advantages of using multi-threaded client.
Processes After today’s lecture, you are asked to know
EEC-681/781 Distributed Computing Systems Lecture 8 Wenbing Zhao Cleveland State University.
1 Chapter 4 Threads Threads: Resource ownership and execution.
Threads, SMP, and Microkernels
Processes After today’s lecture, you are asked to know The basic concept of thread and process. What are the advantages of using multi-threaded client.
Threads. Processes and Threads  Two characteristics of “processes” as considered so far: Unit of resource allocation Unit of dispatch  Characteristics.
Processes After today’s lecture, you are asked to know The basic concept of thread and process. What are the advantages of using multi-threaded client.
A. Frank - P. Weisberg Operating Systems Introduction to Tasks/Threads.
Chapter 3  Processes 1 Processes Chapter 3 Chapter 3  Processes 2 Introduction  A process is a program in execution  For OS important issues are.
1 Processes and Distributed Computing Issues: moving processes around design of server and client processes migration of processes/programs agent programs.
1 Threads Chapter 4 Reading: 4.1,4.4, Process Characteristics l Unit of resource ownership - process is allocated: n a virtual address space to.
Threads Chapter 4. Modern Process & Thread –Process is an infrastructure in which execution takes place  (address space + resources) –Thread is a program.
Chapter 51 Threads Chapter 5. 2 Process Characteristics  Concept of Process has two facets.  A Process is: A Unit of resource ownership:  a virtual.
Processes Part I Processes & Threads* *Referred to slides by Dr. Sanjeev Setia at George Mason University Chapter 3.
Chapter 4 Threads, SMP, and Microkernels Dave Bremer Otago Polytechnic, N.Z. ©2008, Prentice Hall Operating Systems: Internals and Design Principles, 6/E.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED.
9/13/20151 Threads ICS 240: Operating Systems –William Albritton Information and Computer Sciences Department at Leeward Community College –Original slides.
Processes, Threads and Virtualization
Kyung Hee University 1/57 Communication Chapter 3.
Chapter 4 Threads, SMP, and Microkernels Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and Design.
Processes Chapter 3. Table of Contents Multithreading Clients and Servers Code Migration Software Agents (special topic)
Processes Chapter 3. Thread Usage in Nondistributed Systems Context switching as the result of IPC.
Processes and Threads Processes have two characteristics: – Resource ownership - process includes a virtual address space to hold the process image – Scheduling/execution.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Threads, SMP, and Microkernels Chapter 4. Process Resource ownership - process is allocated a virtual address space to hold the process image Scheduling/execution-
DISTRIBUTED SYSTEMS Principles and Paradigms Second Edition ANDREW S
Processes Chapter 3. Processes  OS provides concurrency transparency of multiple processes (sharing CPU, memory)  High price  Process creation  Context.
Processes. Processes and threads Process forms a building block in distributed systems Processes granularity is not sufficient for distributed systems.
Code Migration Russell T. Potee, III. Overview Why Code Migration? Code Migration Models Migration and Handling Resources Heterogeneous Systems Migration.
Distributed Systems Principles and Paradigms Chapter 03 Processes 00 – 1.
Computer Science Lecture 7, page 1 CS677: Distributed OS Multiprocessor Scheduling Will consider only shared memory multiprocessor Salient features: –One.
1 Threads, SMP, and Microkernels Chapter Multithreading Operating system supports multiple threads of execution within a single process MS-DOS.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Lecture 5: Threads process as a unit of scheduling and a unit of resource allocation processes vs. threads what to program with threads why use threads.
Distributed (Operating) Systems -Processes and Threads-
Processes & Threads Introduction to Operating Systems: Module 5.
Acknowledgement: These slides are adapted from slides provided in Thißen & Spaniol's course Distributed Systems and Middleware, RWTH Aachen Processes Distributed.
Processes, Threads and Virtualization Chapter The role of processes in distributed systems.
Threads, SMP, and Microkernels Chapter 4. Processes and Threads Operating systems use processes for two purposes - Resource allocation and resource ownership.
Processes Chapter 3. Processes in Distributed Systems Processes and threads –Introduction to threads –Distinction between threads and processes Threads.
1 Chapter 5: Threads Overview Multithreading Models & Issues Read Chapter 5 pages
Processes and Threads Chapter 3 and 4 Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community College,
DISTRIBUTED SYSTEMS Principles and Paradigms Second Edition ANDREW S
Processes Chapter 3.
Chapter 4 Threads.
Distributed Systems - Comp 655
Processes Chapter 3.
Distributed Computing Systems
Prof. Leonardo Mostarda University of Camerino
Processes Chapter 3.
Processes Chapter 3.
Presentation transcript:

Processes

Processes Illusion of a Virtual processor Process state CPU context (registers, PC, stack pointer, etc) MMU and TLB Thread usage in non-distributed systems Continue execution even after making blocking system calls Increase parallelism in multiprocessor systems Simpler to develop large applications Inter Process Communication (IPC) is expensive

Thread Usage in Nondistributed Systems Context switching as the result of IPC

Thread implementation User-level threads + Easy to create/destroy + Cheap to switch context between threads - Invoking a blocking system call blocks all the threads Kernel –level threads - Create/destroy/switching is expensive Kernel + User level threads Light Weight Process (LWP) runs within the context of a process in Kernel space Multiple LWPs per process Create/destroy/synch threads in user space LWP calls the user space thread scheduler User space threads call thread scheduler as well a system call is performed by switching to LWP in kernel mode

Thread Implementation Combining kernel-level lightweight processes and user-level threads. Scheduler activations by an upcall from Kernel to thread package

Threads in Distributed Systems Multithreaded clients Web browsers: spawning multiple threads to download web page fragments (possible from multiple servers) Multithreaded Servers Dispatche thread Worker threads

Multithreaded Servers A multithreaded server organized in a dispatcher/worker model.

Multithreaded Servers Three ways to construct a server. Model Characteristics Threads Parallelism, blocking system calls Single-threaded process No parallelism, blocking system calls Finite-state machine Parallelism, nonblocking system calls

The X-Window System The basic organization of the X Window System

Clients Thin clients for networking computing Desiderata: Run X-window applications over a WAN and small devices Problem: high network latencies Re-engineer the X protocol ; Compress X messages via a delta-coding+cache Application controls the pixels of the display directly, transfers updates using compression THINC provide higher level display commands that a simple display server can execute Intercept application requests and translate to sequence of display server commands Queue display server commands and transfer in batches

Client-side distribution transparency Access transparency Through client stubs generated by Interface Definition Language (IDL) Location, migration, relocation transparency via using appropriate naming systems Replication transparency: a possible approach

Servers Iterative vs concurrent servers How do clients know the endpoint of a server? Client-to-server binding using a daemon as in DCE Client-to-server binding using a superserver as the inetd in UNIX

Servers How to intrerupt a server? Statefull or state-less server? Abort client (most common approach used!) Out-of-band data by using TCP’s ability to transmit urgent data Statefull or state-less server? Stateless server: keeps no information about its clients and can change state without having to inform any client Soft-state server: keeps client information for limited time, then it behaves as stateless Stateful server: maintains persistent infomation about the clients Permanent state vs (temp) session state 3-tiered applications cookies

Server Clusters Transport-layer switches (TCP handoff) Content-aware request distribution Distributed servers Home network Home agent Home address (HA) Care-of address (CA) Route optimization in MIPv6 Store (HA,CA) pairs at clients Different clients can get different CA

Code Migration Why migration? Each process has Weak mobility Performance, maintenance Each process has Code segment Resource segment Execution segment Weak mobility Transfer only the code segment Strong mobility Can transfer the code and the execution segment Mobility can be Sender initiated Receiver initiated Execution of migrated code can be at the target process or in separate process

Code Migration code migration and its resource segment Process-to-resource binding Binding by identifier: process refers to a resource by its identifier (eg. url, port number, etc) Binding by value: process can use any resource that provides the same value (library, file, etc) Binding by type: process can use any resource of the same type (printer, etc) Resource-to-machine binding Unattached resource: can easily move between machines Fastened resource: possible to move resource at high cost Fixed resource: resource can not move

Code migration Possible actions in code migration with respect to the resource segment

Code migration in heterogeneous systems Late 1970s: PASCAL portability through machine-independent intermediate code Mid 1990s: portability of scripting languages and Java Deja vous PASCAL Migrating virtual memory pages of whole virtual machine Push-all and resend changes Freeze-and-transfer all Pull on demand