OPERATING SYSTEM SUPPORT DISTRIBUTED SYSTEMS CHAPTER 6 Lawrence Heyman July 8, 2002.

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

Threads, SMP, and Microkernels
OPERATING SYSTEM SUPPORT
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.
Modified from Silberschatz, Galvin and Gagne ©2009 Lecture 7 Chapter 4: Threads (cont)
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.
Chapter 5 Processes and Threads Copyright © 2008.
1 Threads, SMP, and Microkernels Chapter 4. 2 Process: Some Info. Motivation for threads! Two fundamental aspects of a “process”: Resource ownership Scheduling.
Threads Clients Servers Code Migration Software Agents Summary
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.
Inter-Process Communication  most OSs provide several abstractions for inter- process communication: message passing, shared memory, etc.  communication.
A. Frank - P. Weisberg Operating Systems Introduction to Tasks/Threads.
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.
14.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts with Java – 8 th Edition Chapter 4: Threads.
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:
9/13/20151 Threads ICS 240: Operating Systems –William Albritton Information and Computer Sciences Department at Leeward Community College –Original slides.
Operating Systems Lecture 09: Threads (Chapter 4)
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 6 Operating System Support. This chapter describes how middleware is supported by the operating system facilities at the nodes of a distributed.
Threads, Thread management & Resource Management.
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.
Multithreading in Java Project of COCS 513 By Wei Li December, 2000.
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.
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-
DISTRIBUTED SYSTEMS Principles and Paradigms Second Edition ANDREW S
Threads G.Anuradha (Reference : William Stallings)
CS333 Intro to Operating Systems Jonathan Walpole.
Chapter 2 Processes and Threads Introduction 2.2 Processes A Process is the execution of a Program More specifically… – A process is a program.
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.
ITFN 3601 Introduction to Operating Systems Lecture 3 Processes, Threads & Scheduling Intro.
IS473 Distributed Systems CHAPTER 6 Operating System Support.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 4: Threads.
Department of Computer Science and Software Engineering
Thread By Group III Kathryn Bean and Wafa’ Jaffal.
Operating Systems: Internals and Design Principles
Distributed Systems : Operating System Support
OPERATING SYSTEM SUPPORT
Operating System Concepts
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.
Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8 th Edition Chapter 4: Threads.
Advanced Operating Systems CS6025 Spring 2016 Processes and Threads (Chapter 2)
1 Chapter 5: Threads Overview Multithreading Models & Issues Read Chapter 5 pages
Chapter 2 Processes and Threads Today 2.1 Processes 2.2 Threads
Chapter 6: Operating System Support
Threads & multithreading
Threads, SMP, and Microkernels
Chapter 15, Exploring the Digital Domain
Threads Chapter 4.
Fast Communication and User Level Parallelism
Threads Chapter 4.
CHAPTER 4:THreads Bashair Al-harthi OPERATING SYSTEM
Chapter 4: Threads.
Presentation transcript:

OPERATING SYSTEM SUPPORT DISTRIBUTED SYSTEMS CHAPTER 6 Lawrence Heyman July 8, 2002

CONTENTS 1.INTRODUCTION 2.THE OPERATING SYSTEM LAYER 3.PROTECTION 4.PROCESSES AND THREADS 5.COMMUNICATION AND INVOCATION 6.OPERATING SYSTEM ARCHITECTURE 7.SUMMARY

OPERATING SYSTEM SUPPORT Important aspect of DS is resource sharing Client applications invoke operations Middleware provides remote invocations between processes at nodes of DS OS is layer below middleware OS supports middleware at nodes of a DS –encapsulation –protection –invocation

TASK OF OS Provide abstraction of physical resources –Processors –Memory –Communications –Storage media System call interface –Files rather than data blocks –Sockets rather than raw network access

NETWORK OS vs DISTRIBUTED OS Multiple system images Autonomous nodes Remote login –rlogin & telnet Control at own node User scheduling Single system image Not autonomous OS controls all nodes Transparent access

REASONS AGAINST DS Investment in current application software Preference for autonomy Combination of Middleware and Network offers balance

WHAT DOES OS PROVIDE? OS running at a node provides abstractions of local hardware resourse Middleware uses these resources for remote invocations at the nodes Kernel and server processes manage resources and provide client interface Clients access resources

PROTECTION Problems –malicious code, bugs –unanticipated behavior –illegitimate access Solutions –use of type-safe language –hardware support at kernel level Price is speed

OS COMPONENTS Process manager Thread manager Communications manager Memory manager Supervisor

PROCESSES & THREADS Process –an execution environment with one or more threads Execution Environment –unit of resource management local kernel-managed resources to which threads have access –the protected domain in which threads exe Thread –the OS abstraction of an activity

PROCESS CREATION Creation of execution environment –Address space –Initialized contents Transparent to user Choice of target host node is policy decision –transfer policy –location policy –sender-initiated –receiver-initiated –migration

ADVANTAGES OF THREADS dynamically created and destroyed maximize concurrent execution maximize throughput (rps) overlap of computation with input/output concurrent processing on multiprocessors –reduces bottlenecks

MULTI-THREAD SERVER ARCHITECTURES 1.Worker-pool 2.Thread-per-request 3.Thread-per-connection 4.Thread-per-object ( Various hybrids also possible )

WORKER-POOL

THREAD-PER-REQUEST

THREAD-PER-CONNECTION

THREAD-PER-OBJECT

THREADS vs MULTIPLE PROCESSES 1.Switching to different thread within process cheaper than switching to thread in 2nd process 2.Threads within process may share resources and data efficiently compared to separate processes 3.Creating new thread within process is cheaper than creating new process 4.Threads within a process not protected from one another

THREADS PROGRAMMING Threads programming is concurrent –C - threads library –Java – methods Threads Lifetimes –New thread created in SUSPENDED state –Made RUNNABLE with start() –Executes on run() method –Ends on return from run() or destroy() Threads groups –Assigned at creation –Security

THREADS PROGRAMMING #2 Threads Synchronization –Local variables are private (private stack) –Synchronized through monitor construct so only one thread can execute at a time in Queue class in Object class Threads Scheduling –Preemptive –Non-preemptive

THREADS PROGRAMMING #3 Threads Implementation –Many kernel-level implementations (NT, Solaris) are multi-level –Creation and management system calls –Schedule threads individually –Threads run-time library Organizes multi-threaded processes Linked to user-level applications Kernel not involved here

User-level threads –Advantages over kernel-level threads –Disadvantages without kernel support Combining user-level and kernel-level enables user-level code provide scheduling hints to kernel’s thread scheduler –Advantages –Disadvantage THREADS PROGRAMMING #4

HIERARCHAL EVENT-LEVEL SCHEDULING User-level scheduler requires kernel to notify it of scheduling-relevant events Each application process contains user- level scheduler –manages threads in that process Kernel allocates virtual processors –application requirements –priority –total demand

ASSIGNMENT OF VIRTUAL PROCESSORS

TYPES OF EVENTS Scheduler Activation call from kernel notifies process scheduler of an event –Virtual Processor Added (ready thread) –SA blocked –SA unblocked –SA preempted Advantages –allocation based on user-level priorities –kernel does not influence user-level scheduler’s behavior

EVENTS SCHEDULING

SUMMARY OS Support of middleware –Implementing of resource management policy –Encapsulation and protection of resources –Allows concurrent sharing of resources Processes –Execution environment Address space Communication interfaces Local resources, i.e., semaphores –Threads – kernel-level & user-level Share the execution environment Cheap concurrency Parallel multiprocessors

THE END