Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 © Addison-Wesley Publishers 2000 1 Distribuerede.

Slides:



Advertisements
Similar presentations
Threads, SMP, and Microkernels
Advertisements

OPERATING SYSTEM SUPPORT
Operating System Architecture and Distributed Systems
More on Processes Chapter 3. Process image _the physical representation of a process in the OS _an address space consisting of code, data and stack segments.
Chorus and other Microkernels Presented by: Jonathan Tanner and Brian Doyle Articles By: Jon Udell Peter D. Varhol Dick Pountain.
Slides for Chapter 6: Operating System support From Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edition 3, © Addison-Wesley.
Lecture 6: Operating System Support Haibin Zhu, PhD. Assistant Professor Department of Computer Science Nipissing University © 2002.
Copyright © George Coulouris, Jean Dollimore, Tim Kindberg This material is made available for private study and for direct.
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.
Computer Systems/Operating Systems - Class 8
Slides for Chapter 6: Operating System support From Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edition 3, © Addison-Wesley.
Page 1 Processes and Threads Chapter Processes 2.2 Threads 2.3 Interprocess communication 2.4 Classical IPC problems 2.5 Scheduling.
User Level Interprocess Communication for Shared Memory Multiprocessor by Bershad, B.N. Anderson, A.E., Lazowska, E.D., and Levy, H.M.
3.5 Interprocess Communication Many operating systems provide mechanisms for interprocess communication (IPC) –Processes must communicate with one another.
3.5 Interprocess Communication
1 Chapter 4 Threads Threads: Resource ownership and execution.
A. Frank - P. Weisberg Operating Systems Introduction to Tasks/Threads.
Exercises for Chapter 6: Operating System Support
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.
Slide 3-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3 Operating System Organization.
Chapter 51 Threads Chapter 5. 2 Process Characteristics  Concept of Process has two facets.  A Process is: A Unit of resource ownership:  a virtual.
Chapter 8 Windows Outline Programming Windows 2000 System structure Processes and threads in Windows 2000 Memory management The Windows 2000 file.
Chapter 4 Threads, SMP, and Microkernels Dave Bremer Otago Polytechnic, N.Z. ©2008, Prentice Hall Operating Systems: Internals and Design Principles, 6/E.
Introduction The operating system layer Protection Processes and Threads Communication and invocation Operating system architecture Summary Chapter 6:
1 Lecture 4: Threads Operating System Fall Contents Overview: Processes & Threads Benefits of Threads Thread State and Operations User Thread.
Chapter 6 Operating System Support. This chapter describes how middleware is supported by the operating system facilities at the nodes of a distributed.
From Coulouris, Dollimore, Kindberg and Blair Distributed Systems: Concepts and Design Edition 5, © Addison-Wesley 2012 Exercises for Chapter 7 Operating.
Chapter 4 Threads, SMP, and Microkernels Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and Design.
1 Threads, SMP, and Microkernels Chapter 4. 2 Focus and Subtopics Focus: More advanced concepts related to process management : Resource ownership vs.
Recall: Three I/O Methods Synchronous: Wait for I/O operation to complete. Asynchronous: Post I/O request and switch to other work. DMA (Direct Memory.
Processes and Threads Processes have two characteristics: – Resource ownership - process includes a virtual address space to hold the process image – Scheduling/execution.
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
Copyright © George Coulouris, Jean Dollimore, Tim Kindberg This material is made available for private study and for direct.
Threads, SMP, and Microkernels Chapter 4. Process Resource ownership - process is allocated a virtual address space to hold the process image Scheduling/execution-
CE Operating Systems Lecture 3 Overview of OS functions and structure.
Threads G.Anuradha (Reference : William Stallings)
OPERATING SYSTEM SUPPORT DISTRIBUTED SYSTEMS CHAPTER 6 Lawrence Heyman July 8, 2002.
Processes Introduction to Operating Systems: Module 3.
Processes and Process Control 1. Processes and Process Control 2. Definitions of a Process 3. Systems state vs. Process State 4. A 2 State Process Model.
Modern Operating Systems B.Ramamurthy Chapter 2, Section 2.4.
1 Threads, SMP, and Microkernels Chapter Multithreading Operating system supports multiple threads of execution within a single process MS-DOS.
Middleware Services. Functions of Middleware Encapsulation Protection Concurrent processing Communication Scheduling.
IS473 Distributed Systems CHAPTER 6 Operating System Support.
A. Frank - P. Weisberg Operating Systems Structure of Operating Systems.
Operating Systems: Internals and Design Principles
Distributed Systems : Operating System Support
From Coulouris, Dollimore, Kindberg and Blair Distributed Systems: Concepts and Design Edition 5, © Addison-Wesley 2012 Slides for Chapter 7: Operating.
Distributed Operating Systems CS551 Colorado State University at Lockheed-Martin Lecture 2 -- Spring 2001.
OPERATING SYSTEM SUPPORT
Exercises for Chapter 1: Characterization of Distributed Systems From Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edition.
1 Threads, SMP, and Microkernels Chapter 4. 2 Process Resource ownership - process includes a virtual address space to hold the process image Scheduling/execution-
Threads, SMP, and Microkernels Chapter 4. Processes and Threads Operating systems use processes for two purposes - Resource allocation and resource ownership.
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
Introduction to Operating Systems Concepts
Processes and Threads Processes and their scheduling
Chapter 2 Processes and Threads Today 2.1 Processes 2.2 Threads
Chapter 6: Operating System Support
CS490 Windows Internals Quiz 2 09/27/2013.
The operation system layer Protection Processes and threads
Programming Models for Distributed Application
Threads, SMP, and Microkernels
Slides for Chapter 6: Operating System support
Mid Term review CSC345.
Process Description and Control
Lecture 4- Threads, SMP, and Microkernels
Threads Chapter 4.
Process Description and Control
Operating Systems: A Modern Perspective, Chapter 3
Chapter 2 Processes and Threads 2.1 Processes 2.2 Threads
Presentation transcript:

Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 © Addison-Wesley Publishers Distribuerede systemer – 19. februar 2001 Presentation based on slides by Coulouris et al, modified by Jens B Jorgensen

2 Chapter 6: Operating System Support From Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edition 3, © Addison-Wesley 2001

Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 © Addison-Wesley Publishers Operating systems - basics zProvide problem-oriented abstractions of the underlying physical resources – the processors, communications, and storage media. zExamples: UNIX, Windows NT. zNetwork operating systems: yCan be used to access remote resources. yNodes retain autonomy in managing their own processing resources. yUsers can remotely log in to another computer. zDistributed operating systems: yUsers are never concerned with where their programs run. yUsers are never concerned with the location of resources. ySingle system image.

Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 © Addison-Wesley Publishers Operating systems – combined with middleware zNo distributed operating systems in generel use. zCombination of middleware and network operating systems provides a balance between: yRequirement for autonomy. yNetwork-transparent resource access. zThe operating system running at a node provides abstractions for local hardware resources. zThe middleware provides mechanisms for remote invocations between objects or processes at the nodes.

Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 © Addison-Wesley Publishers Operating systems - system layers

Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 © Addison-Wesley Publishers Operating systems – components of interest zKernel: A program that always runs and has complete privileges for the physical resources on its host computer. zServer processes: Manage resources (together with the kernel) and present clients with an interface to the resources. zClient processes: Access resources.

Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 © Addison-Wesley Publishers Operating system – requirements to kernel and server processes zEncapsulation: They should provide a useful service interface to their resources – that is, a set of operations that meet their clients’ needs. zProtection: Resources require protection from illegitimate accesses. zConcurrent processing: Clients may share resources and access them concurrently. Resource managers are responsible for achieving concurrency transparency.

Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 © Addison-Wesley Publishers Operating system – invocation-related tasks zCommunication: Operation parameters and results have to be passed to and from resource managers, over a network or within a computer. zScheduling: When an operation is invoked, its processing must be scheduled within the kernel or server.

Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 © Addison-Wesley Publishers Operating systems - core functionality (1)

Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 © Addison-Wesley Publishers Operating systems - core functionality (2) zProcess manager: Handles the creation of and operations upon processes. zThread manager: Thread creation, synchronization, and scheduling. zCommunication manager: Communication between threads attached to different processes on the same computer. zMemory manager: Management of physical and virtual memory. zSupervisor: Dispatching of interrupts, system call traps, etc.

Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 © Addison-Wesley Publishers Operating systems - protection zResources require protection from illegitimate access. zUse type-safe programming languages. zEmploy hardware support.

Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 © Addison-Wesley Publishers Operating systems – the kernel zControls the memory management unit and processor registers so that no other code may access the machine’s physical resources except in acceptable ways. zRuns with processor in supervisor/privileged mode (other processes in user/unprivileged mode). zSets up address spaces to protect itself and other processes from the accesses of an aberrant process. zTransfer from user-level to kernel’s address space via exceptions, such as system call traps.

Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 © Addison-Wesley Publishers Processes - processes and threads zProcess: Execution environment together with one or more threads. zThread: Operating system abstraction of an activity. zExecution environment includes: yAn address space. yThread synchronization and communication resources such as semaphores and communication interfaces. yHigher-level resources such as open files and windows. zThreads may share an execution environment. zAn execution environment provides protection from threads outside it.

Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 © Addison-Wesley Publishers Processes – creation of a new process zChoice of process host: yTransfer policy: Situate new process locally or remotely? yLocation policy: Which node should host new process? yStatic location policy. yAdaptive location policy. yLoad-sharing. zCreation of a new execution environment: yAddress space is of statically defined format. yAddress space defined with respect to existing execution environment.

Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 © Addison-Wesley Publishers Threads – why? zImprove performance! zExecution environments normally expensive to create and manage. zUtilize parallelism. zExample: yClient-server. yProcessing of each request takes 2 millisecond. yDisk access takes 8 milliseconds. y100 client requests per second with one thread. yMore client request per second with more threads (up to 500 requests per second – with caching).

Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 © Addison-Wesley Publishers Threads - worker pool architecture Server N threads Input-output Client Thread 2 makes T1 Thread 1 requests to server generates results Requests Receipt & queuing Fixed pool of ‘worker’ threads, I/O thread, shared request queue; Inflexible, high level of switching between the I/O and worker threads.

Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 © Addison-Wesley Publishers Threads – threads-per-request architecture remote workers I/O objects I/O thread spawns a new worker thread for each request, worker destroys itself when job is done; no contention for shared queue, higher throughput, overhead in thread creation and destruction.

Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 © Addison-Wesley Publishers Threads – thread-per-connection architecture remote per-connection threads objects A thread associated with each connection; lower thread-management overhead than per-request, some threads may be idle while others have outstanding requests.

Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 © Addison-Wesley Publishers Thread – threads-per-object architecture remote I/O per-object threads objects A thread associated with each remote object; lower thread-management overhead than per-request, some threads may be idle while others have outstanding requests.

Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 © Addison-Wesley Publishers Threads – threads in clients Server N threads Input-output Client Thread 2 makes T1 Thread 1 requests to server generates results Requests Receipt & queuing

Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 © Addison-Wesley Publishers Threads – threads versus multiple processes zCreating a new thread within an existing process is cheaper than creating a process. zSwitching to a different thread within the same process is cheaper than switching between threads belonging to different processes. zThreads within a process may share data and other resources conveniently and efficiently compared with separate processes. zThreads within a process are not protected from one another.

Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 © Addison-Wesley Publishers Threads – programming issues zThread lifetimes zThread synchronization. zThread scheduling. zThreads implementation.

Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 © Addison-Wesley Publishers Threads - Java thread constructor and management methods Thread(ThreadGroup group, Runnable target, String name) Creates a new thread in the SUSPENDED state, which will belong to group and be identified as name; the thread will execute the run() method of target. setPriority(int newPriority), getPriority() Set and return the thread’s priority. run() A thread executes the run() method of its target object, if it has one, and otherwise its own run() method (Thread implements Runnable). start() Change the state of the thread from SUSPENDED to RUNNABLE. sleep(int millisecs) Cause the thread to enter the SUSPENDED state for the specified time. yield() Enter the READY state and invoke the scheduler. destroy() Destroy the thread.

Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 © Addison-Wesley Publishers Communication and invocation – basic questions zWhat communication primitives does the OS supply? zWhich protocols does it support and how open is the communication implementation? zWhat steps are taken to make communication as efficient as possible? zWhat support is provided for high-latency and disconnected operations?

Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 © Addison-Wesley Publishers Communication and invocation – invocation performance zInvocation performance a critical factor in distributed system design. zSoftware overheads often predominate over network bandwidth (LAN). zIssues: ySynchronous or asynchronous? yInvolves a domain transition? yInvolves network communication? yInvolves thread scheduling and switching?

Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 © Addison-Wesley Publishers Communication and invocation - invocations between address spaces

Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 © Addison-Wesley Publishers Communication and invocation - RPC delay against parameter size

Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 © Addison-Wesley Publishers Communication and invocation – times for serialized and concurrent invocations

Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 © Addison-Wesley Publishers Operating system architecture – basic requirements zRun only that system software at each computer that is necessary for it to carry out its particular role in the system architecture. zAllow the software (and the computer) implementing any particular service to be changed independently of other facilities. zAllow for alternatives of the same service to be provided, when this is required to suit different users or applications. zIntroduce new services without harming the integrity of existing ones.

Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 © Addison-Wesley Publishers Operating system architecture – monolithic kernels and microkernels (1) zDiffers primarily in the decision as to what functionality belongs in the kernel and what is to be left to server processes that can be dynamically loaded to run on top of it. zMonolithic: Massive, undifferentiated, intractable. zMicrokernel: Provides only the most basic abstractions, principally address spaces, threads and local interprocess communication; all other system services are provided by servers that are dynamically loaded.

Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 © Addison-Wesley Publishers Operating system architecture - monolithic kernel and microkernel (2)

Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 © Addison-Wesley Publishers Operating system architecture - the role of the microkernel

Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 © Addison-Wesley Publishers Summary zOperating systems. zProcesses. zThreads. zCommunication and invocation. zOperating system architectures.