Learning Objectives Understanding the difference between processes and threads. Understanding process migration and load distribution. Understanding Process.

Slides:



Advertisements
Similar presentations
Remote Procedure Call (RPC)
Advertisements

Chorus and other Microkernels Presented by: Jonathan Tanner and Brian Doyle Articles By: Jon Udell Peter D. Varhol Dick Pountain.
Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8 th Edition Chapter 4: Threads.
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 3: Processes.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 5: Threads Overview Multithreading Models Threading Issues Pthreads Solaris.
Operating System Concepts with Java – 7 th Edition, Nov 15, 2006 Silberschatz, Galvin and Gagne ©2007 Chapter 3: Processes.
3.5 Interprocess Communication Many operating systems provide mechanisms for interprocess communication (IPC) –Processes must communicate with one another.
3.5 Interprocess Communication
Threads CSCI 444/544 Operating Systems Fall 2008.
Chapter 3: Processes. Process Concept Process Scheduling Operations on Processes Cooperating Processes Interprocess Communication Communication in Client-Server.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 4: Processes Process Concept Process Scheduling Operations on Processes Cooperating.
Chapter 3: Processes. 3.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts - 7 th Edition, Feb 7, 2006 Chapter 3: Processes Process Concept.
1 Chapter 4 Threads Threads: Resource ownership and execution.
Chapter 4: Threads. 4.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Objectives Thread definitions and relationship to process Multithreading.
Process Concept An operating system executes a variety of programs
Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8 th Edition Chapter 4: Threads.
Interprocess Communication. Process Concepts Last class.
Chapter 51 Threads Chapter 5. 2 Process Characteristics  Concept of Process has two facets.  A Process is: A Unit of resource ownership:  a virtual.
1 Lecture 4: Threads Operating System Fall Contents Overview: Processes & Threads Benefits of Threads Thread State and Operations User Thread.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 5: Threads Overview Multithreading Models Threading Issues Pthreads Solaris.
Multithreading Allows application to split itself into multiple “threads” of execution (“threads of execution”). OS support for creating threads, terminating.
Silberschatz, Galvin and Gagne ©2011Operating System Concepts Essentials – 8 th Edition Chapter 4: Threads.
Chapter 4: Processes Process Concept Process Scheduling Operations on Processes Cooperating Processes Inter-process Communication Communication in Client-Server.
Process Management. Processes Process Concept Process Scheduling Operations on Processes Interprocess Communication Examples of IPC Systems Communication.
Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8 th Edition Chapter 4: Threads.
Process Concept Process Scheduling Operations on Processes Cooperating Processes Interprocess Communication Communication in Client-Server Systems.
Chapter 4 Threads, SMP, and Microkernels Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and Design.
Introduction to Distributed Systems Slides for CSCI 3171 Lectures E. W. Grundke.
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
Threads, SMP, and Microkernels Chapter 4. Process Resource ownership - process is allocated a virtual address space to hold the process image Scheduling/execution-
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 13 Threads Read Ch 5.1.
3.1 Silberschatz, Galvin and Gagne ©2009Operating System Concepts with Java – 8 th Edition Chapter 3: Processes.
Chapter 3: Processes. 3.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts - 7 th Edition, Feb 7, 2006 Outline n Process Concept n Process.
1 11/1/2015 Chapter 4: Processes l Process Concept l Process Scheduling l Operations on Processes l Cooperating Processes l Interprocess Communication.
Threads G.Anuradha (Reference : William Stallings)
Hwajung Lee.  Interprocess Communication (IPC) is at the heart of distributed computing.  Processes and Threads  Process is the execution of a program.
CS533 - Concepts of Operating Systems 1 The Mach System Presented by Catherine Vilhauer.
Processes CSCI 4534 Chapter 4. Introduction Early computer systems allowed one program to be executed at a time –The program had complete control of the.
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Lecture 3 Operating Systems.
PREPARED BY : MAZHAR JAVED AWAN BSCS-III Process Communication & Threads 4 December 2015.
Chapter 3: Process-Concept. Process Concept Process Scheduling Operations on Processes Cooperating Processes Interprocess Communication Communication.
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.
Multithreaded Programing. Outline Overview of threads Threads Multithreaded Models  Many-to-One  One-to-One  Many-to-Many Thread Libraries  Pthread.
Chapter 4: Multithreaded Programming. 4.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts What is Thread “Thread is a part of a program.
3.1 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 3: Processes Overview: Process Concept Process Scheduling Operations on Processes.
Department of Computer Science and Software Engineering
Lecture 4 Mechanisms & Kernel for NOSs. Mechanisms for Network Operating Systems  Network operating systems provide three basic mechanisms that support.
Processes. Process Concept Process Scheduling Operations on Processes Interprocess Communication Communication in Client-Server Systems.
Lecture 4: Processes & Threads. Lecture 4 / Page 2AE4B33OSS Silberschatz, Galvin and Gagne ©2005 Contents The concept of Process Process states and life-cycle.
 Process Concept  Process Scheduling  Operations on Processes  Cooperating Processes  Interprocess Communication  Communication in Client-Server.
Distributed Operating Systems CS551 Colorado State University at Lockheed-Martin Lecture 2 -- Spring 2001.
Operating Systems Unit 2: – Process Context switch Interrupt Interprocess communication – Thread Thread models Operating Systems.
Chapter 4: Processes Process Concept Process Scheduling Operations on Processes Cooperating Processes Interprocess Communication Communication in Client-Server.
Operating System Concepts
Threads, SMP, and Microkernels Chapter 4. Processes and Threads Operating systems use processes for two purposes - Resource allocation and resource ownership.
Lecturer 3: Processes multithreaded Operating System Concepts Process Concept Process Scheduling Operation on Processes Cooperating Processes Interprocess.
1 Chapter 5: Threads Overview Multithreading Models & Issues Read Chapter 5 pages
Lecture 5. Example for periority The average waiting time : = 41/5= 8.2.
OPERATING SYSTEM CONCEPT AND PRACTISE
Chapter 3: Process Concept
Chapter 2 Processes and Threads Today 2.1 Processes 2.2 Threads
Process Management Presented By Aditya Gupta Assistant Professor
Processes Overview: Process Concept Process Scheduling
Threads & multithreading
Operating System Concepts
Threads, SMP, and Microkernels
Lecture 4- Threads, SMP, and Microkernels
Multithreaded Programming
Presentation transcript:

Learning Objectives Understanding the difference between processes and threads. Understanding process migration and load distribution. Understanding Process Inter-process Communication in Distributed Systems Lecture 2

The Kernel The kernel is a (often memory resident) part of the operating system that has access rights to ALL system resources. The kernel of a distributed system usually has access only to local resources. ? What o.s. components should be part of the kernel? Lecture 2

Kernel Types Monolithic Kernel Microkernel Unix, VMS. Chorus (base technology for JavaOS) Mach more suitable for distributed computing Lecture 2

Processes Process is a fundamental concept of computer system operation : it is a program in execution. ? What are properties of a process? ? What constitutes a process? ? What does a process need in order to accomplish its task? Lecture 2

Process Management Process management in distributed systems involves: process creation process type identification process migration process scheduling process status control process termination and clean up Lecture 2

Types of processes in distributed and parallel systems. Indivisible processes (entire process must be assign to a single processor). Divisible processes (a process may be subdivided into smaller sub-processes, tasks, or threads.) TIG (Task Interaction Graph) represents relationships between tasks of a divisible process. (see box 2.4 p.42) Lecture 2

Load Distribution and Process Migration Process migration involves relocation of a process to remote processor (computer). Goal of load distribution: balance the job load among computers in the system provide better response time of computations Lecture 2

Two Components of Load Balancing Algorithms Information Gathering gather info about loads of other processors and select a suitable migration partner e.g. identifies idle processors, estimate cost of migration to various sites Process Selection select a process to migrate e.g. what is the communication delay for migrating a process, how to accommodate differences in heterogeneous systems Lecture 2

External Data Representation Heterogeneous systems imply different CPUs, different software configurations and different data representation External Data Representation is a common representation of data used in heterogeneous systems. External Data Representation greatly reduces the amount of time required to perform cross-platform process migration. Lecture 2

Benefits of External Data Representation Study figures 2.6 and 2.7 and solve problem 2.9 on page 51. Lecture 2

Load balancing decision examples Consider the formula for Total_Weight on page 50. Use this formula with Weighting 1 parameters (0.25, 0.25, 0.25, 0.25) in order to determine which is the best location for process migration from exercise 2.6. Lecture 2

Threads Thread is a basic unit of process execution. “Mini-process” (“lightweight process) Operating system allowing for multiple threads of execution are referred as multi-threaded (Windows NT, 2000, Unix) Languages that support multithreading include C, C++, Java. Lecture 2

Thread Properties A process may have multiple threads of control. Each thread has its own program counter and stack, register set, child threads, and state. Threads share address space and global variables. Lecture 2

Threads versus Processes Per Thread Items PC Stack Register set Child threads State Per Process Items Address space Global variables Open files Child processes Signals/IPC Lecture 2

Multithreaded Support Posix.1c specifies a standard for threads and their implementation. Posix Threads Java support for multithreaded programming Threads are treated like other objects. Must be instantiated with a parameter that is a runable object (runable objects define a run() method) See box 2.2 p. 37 for Thread constructor prototypes and sample methods Lecture 2

Multithreaded Code Process versus threads example Posix Threads Example Multithreaded programming paradigms specialist paradigm client/server paradigm assembly line paradigm ? Read paragraph 2.2.2 p.34 and answer question 2.2. on page 49. Lecture 2

Processes and Threads in Windows’98 Windows 95/98 NT and 2000 utilize multithreading. Check the following file to processes and threads in Windows C:\Program Files\DevStudio\Vc\bin\Win95\Pview95 Lecture 2

Inter-process Communication Inter-process Communication is an essential component of distributed computing. WHY? Lecture 2

Common IPC Primitives Messages Pipes Sockets RPCs (Remote Procedure Calls) Lecture 2

Message Passing Message passing involves copying of data from one process address space to another process address space. Primitives used: msgSent (dest, text) msgReceive (source, text) Lecture 2

Blocking and Non-blocking Primitives Blocking msgSend waits (blocks awaiting) for acknowledgment Blocking msgReceive waits (block awaiting) for the messages Sometimes called synchronous Non-blocking msgSend sends the message and does not wait for ack. Non-blocking msgReceive does not wait for a messages. Sometimes called asynchronous Lecture 2

Message Addressing One-to-many (multiple receivers, single sender) Many-to-one (multiple senders, one receiver) Many-to-many (multiple receivers, multiple senders) Lecture 2

Pipes Communication takes via a memory buffer. One-to-one type Unnamed pipes allow for communication between related processes (e.g. parent and child) Named pipes allow for communication between unrelated processes (see Box 3.3 p.64 for details) Lecture 2

Sockets Used for communication across the network. Low level primitives. Requires 6-8 steps (create socket, bind, connect, listen, send receive, shutdown.) Supported by Unix and Java (see box 3.4 and 3.5 pp. 70 and 71) Lecture 2

Remote Procedure Calls RPC is a high level, blocking primitive. Allows communication between remote computers using techniques similar to traditional procedure calls. Allows for complex data structures to be passed as parameters. Lecture 2

RPC features Parameter Type Data Type Support Parameter Marshalling RPC Binding RPC Authentication RPC Semantics Lecture 2

RPC Semantics At-Most-Once At-Least-Once Last-of-Many-Call Idempotent Lecture 2

Parameter Type Input only Output only Input/output per value receive from the server Input/output call by value/results Lecture 2

Data Type Support Allow/disallow some data types (e.g. pointers or complex structures.) Limit the number of parameters passed Lecture 2

Parameter Marshalling Packing of parameters to minimize the amount of information sent across the network. Use of stubs on client and server sites. Lecture 2

RPC Binding Binding involves Binding can be accomplished at port mapping for the server assigning a port handler for the client see fig. 3.10 p.74 Binding can be accomplished at compile time link time run time Lecture 2

RPC Authentication Client/server authentication might be needed to assure security of data transmisison. Lecture 2