Processes Chapter 3.

Slides:



Advertisements
Similar presentations
Processes and Threads Chapter 3 and 4 Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community College,
Advertisements

CS-495 Distributed Systems Fabián E. Bustamante, Winter 2004 Processes Threads & OS Threads in distributed systems Object servers Code migration Software.
Chapter 4 Threads Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and Design Principles, 6/E William.
Processes: Code Migration Chapter 3 Will Cameron CSC 8530 Dr. Schragger.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved Managing Server.
Chapter 4 Threads, SMP, and Microkernels Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and Design.
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.
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.
Computer Science Lecture 8, page 1 CS677: Distributed OS Code and Process Migration Motivation How does migration occur? Resource migration Agent-based.
Processes Chapter 3. Thread Usage in Nondistributed Systems Context switching as the result of IPC –Process: a running program (mgmt. unit of OS) –Thread:
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 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 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.
Processes Chapter 3.
1 Processes and Distributed Computing Issues: moving processes around design of server and client processes migration of processes/programs agent programs.
Give an example to show the advantages to using multithreaded Clients See page 142 of the core book (Tanebaum 2002).
Processes.
Processes Part I Processes & Threads* *Referred to slides by Dr. Sanjeev Setia at George Mason University Chapter 3.
Introduction Chapter 1. Definition of a Distributed System A distributed system [Tannenbaum & Steen] can be defined as a collection of independent computers.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED.
Kyung Hee University 1/57 Communication Chapter 3.
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.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
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.
OPERATING SYSTEM SUPPORT DISTRIBUTED SYSTEMS CHAPTER 6 Lawrence Heyman July 8, 2002.
Processes. Processes and threads Process forms a building block in distributed systems Processes granularity is not sufficient for distributed systems.
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.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved Thread Usage.
Processes Chapter 3. Processes Process: Program in execution. In DSs, more concepts come into consideration, eg. Multi-treading, process migration, code.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
1 Reasons for Migrating Code The principle of dynamically configuring a client to communicate to a server. The client first fetches the necessary software,
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.
Processes Chapter 3. Processes Topics discussed in this chapter: –Threads improve performance. In distributed systems threads allow clients can servers.
Distributed Systems: Principles and Paradigms By Andrew S. Tanenbaum and Maarten van Steen.
CSC 322 Operating Systems Concepts Lecture - 7: by Ahmed Mumtaz Mustehsan Special Thanks To: Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall,
Processes Chapter 3. Processes in Distributed Systems Processes and threads –Introduction to threads –Distinction between threads and processes Threads.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Processes Chapter 3. Processes  Process is a program in running state  PROCESSES ARE THE BUILDING BLOCKS OF DISTRIBUTED SYSTEMS, ESPECIALLY IN unix.
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
Threads & Multithreading
Definition of Distributed System
Processes and Threads Processes and their scheduling
OPERATING SYSTEMS CS3502 Fall 2017
Chapter 2 Processes and Threads Today 2.1 Processes 2.2 Threads
DISTRIBUTED SYSTEMS Principles and Paradigms Second Edition ANDREW S
Chapter 4 Threads.
Operating System Concepts
Operating Systems Processes and Threads.
Distributed Systems - Comp 655
Chapter 4: Threads.
DISTRIBUTED SYSTEMS Principles and Paradigms Second Edition ANDREW S
Processes Chapter 3.
Slides for Chapter 6: Operating System support
Threads Chapter 4.
Prof. Leonardo Mostarda University of Camerino
DISTRIBUTED SYSTEMS Principles and Paradigms Second Edition ANDREW S
Chapter 4: Threads.
Processes Chapter 3.
DISTRIBUTED SYSTEMS Principles and Paradigms Second Edition ANDREW S
Processes Chapter 3.
Threads CSE 2431: Introduction to Operating Systems
Presentation transcript:

Processes Chapter 3

Chapter Outline Processes versus threads Client Organization Server Organization Code Migration

Why Threads? Implications Granularity of processes in existing operating systems not sufficient for efficient processor utilization. Threads do not attempt to achieve a high degree of concurrency transparency A thread context is very small in comparison to a process Implications performance of a multi-threaded application usually better than a single threaded counterpart. Threads are not automatically protected against each other so development of multi-threaded applications slightly harder

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

Thread Implementation User-level threads Cheap to create and destroy threads Switching thread context involves only switching thread stack Invocation of a blocking system call blocks the entire process Kernel-level threads Every thread operation carried out by kernel Switching thread context is expensive Light weight processes (LWP) A hybrid between user-level and kernel-level threads Executes in the context of a process, and there can be several LWPs per process

Thread Implementation Combining kernel-level lightweight processes and user-level threads.

Clients X Window System Client side transparency Performance and correctness Location transparency Migration Transparency Relocation Transparency Replication Transparency Concurrency Transparency

The basic organization of the X Window System

Client-Side Software for Distribution Transparency A possible approach to transparent replication of a remote object using a client-side solution.

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

Servers: General Design Issues 3.7 Client-to-server binding Globally known end points End point Table Super Servers Server State

Object Adapter (1) Organization of an object server supporting different activation policies.

Object Adapter (2) /* Definitions needed by caller of adapter and adapter */ #define TRUE #define MAX_DATA 65536 /* Definition of general message format */ struct message { long source /* senders identity */ long object_id; /* identifier for the requested object */ long method_id; /* identifier for the requested method */ unsigned size; /* total bytes in list of parameters */ char **data; /* parameters as sequence of bytes */ }; /* General definition of operation to be called at skeleton of object */ typedef void (*METHOD_CALL)(unsigned, char* unsigned*, char**); long register_object (METHOD_CALL call); /* register an object */ void unrigester_object (long object)id); /* unrigester an object */ void invoke_adapter (message *request); /* call the adapter */ The header.h file used by the adapter and any program that calls an adapter.

The thread.h file used by the adapter for using threads. Object Adapter (3) typedef struct thread THREAD; /* hidden definition of a thread */ thread *CREATE_THREAD (void (*body)(long tid), long thread_id); /* Create a thread by giving a pointer to a function that defines the actual */ /* behavior of the thread, along with a thread identifier */ void get_msg (unsigned *size, char **data); void put_msg(THREAD *receiver, unsigned size, char **data); /* Calling get_msg blocks the thread until of a message has been put into its */ /* associated buffer. Putting a message in a thread's buffer is a nonblocking */ /* operation. */ The thread.h file used by the adapter for using threads.

Object Adapter (4) The main part of an adapter that implements a thread-per-object policy.

Reasons for Migrating Code The principle of dynamically configuring a client to communicate to a server. The client first fetches the necessary software, and then invokes the server.

Models for Code Migration Alternatives for code migration.

Migration and Local Resources Resource-to machine binding Unattached Fastened Fixed By identifier By value By type MV (or GR) CP ( or MV, GR) RB (or GR, CP) GR (or MV) GR (or CP) GR RB (or GR) Process-to-resource binding Actions to be taken with respect to the references to local resources when migrating code to another machine.

Migration in Heterogeneous Systems 3-15 The principle of maintaining a migration stack to support migration of an execution segment in a heterogeneous environment

References Lecture slides of Distributed Systems principles and paradigms by Andrew Tannenbaum and Van Steen, Prentice Hall India, 2002.