Operating System 4 THREADS, SMP AND MICROKERNELS

Similar documents
Chapter 4 Threads, SMP, and

Operating Systems: Internals and Design Principles. Chapter 4 Threads Seventh Edition By William Stallings

ECE519 Advanced Operating Systems

For use by students enrolled in #71251 CSE430 Fall 2012 at Arizona State University. Do not use if not enrolled.

Process Characteristics

Processes, Threads, SMP, and Microkernels

Threads, SMP, and Microkernels. Chapter 4

Operating Systems. Engr. Abdul-Rahman Mahmood MS, PMP, MCP, QMR(ISO9001:2000) alphapeeler.sf.net/pubkeys/pkey.htm

UNIT 3. PROCESS MANAGEMENT

Operating System. Chapter 4. Threads. Lynn Choi School of Electrical Engineering

CSCI 4717 Computer Architecture

Process Characteristics. Threads Chapter 4. Process Characteristics. Multithreading vs. Single threading

Threads Chapter 4. Reading: 4.1,4.4, 4.5

PESIT Bangalore South Campus Hosur road, 1km before Electronic City, Bengaluru -100 Department of MCA

CSE 306/506 Operating Systems Threads. YoungMin Kwon

Motivation. Threads. Multithreaded Server Architecture. Thread of execution. Chapter 4

Non-uniform memory access machine or (NUMA) is a system where the memory access time to any region of memory is not the same for all processors.

Chapter 3 Process Description and Control

Operating Systems. Lecture 4. Nachos Appetizer

Threads, SMP, and Microkernels

Threads. CS3026 Operating Systems Lecture 06

Threads Chapter 5 1 Chapter 5

Computer Organization. Chapter 16

2017 Pearson Educa2on, Inc., Hoboken, NJ. All rights reserved.

Organisasi Sistem Komputer

Operating Systems: Internals and Design Principles. Chapter 2 Operating System Overview Seventh Edition By William Stallings

Operating System Architecture. CS3026 Operating Systems Lecture 03

Operating System. Operating System Overview. Layers of Computer System. Operating System Objectives. Services Provided by the Operating System

Operating System Overview. Operating System

FLYNN S TAXONOMY OF COMPUTER ARCHITECTURE

Multithreading. Reading: Silberschatz chapter 5 Additional Reading: Stallings chapter 4

Operating Systems Overview. Chapter 2

CSE 4/521 Introduction to Operating Systems. Lecture 29 Windows 7 (History, Design Principles, System Components, Programmer Interface) Summer 2018

Chapter 18 Parallel Processing

Processes and Threads. Processes and Threads. Processes (2) Processes (1)

Operating System Overview. Chapter 2

Computer parallelism Flynn s categories

CSCI-GA Operating Systems Lecture 3: Processes and Threads -Part 2 Scheduling Hubertus Franke

Operating Systems : Overview

Parallel Processing. Computer Architecture. Computer Architecture. Outline. Multiple Processor Organization

Introduction II. Overview

Operating Systems Overview

Multiprocessors - Flynn s Taxonomy (1966)

Chapter 1: Introduction

Introduction to Parallel Processing

ARCHITECTURAL CLASSIFICATION. Mariam A. Salih

OPERATING SYSTEM : RBMCQ0402. Third RavishBegusarai.

The modularity requirement

Exercise (could be a quiz) Solution. Concurrent Programming. Roadmap. Tevfik Koşar. CSE 421/521 - Operating Systems Fall Lecture - IV Threads

Commercial Real-time Operating Systems An Introduction. Swaminathan Sivasubramanian Dependable Computing & Networking Laboratory

Computer and Information Sciences College / Computer Science Department CS 207 D. Computer Architecture. Lecture 9: Multiprocessors

Parallel Processors. The dream of computer architects since 1950s: replicate processors to add performance vs. design a faster processor

Operating Systems. Chapter 4 Threads. Lei Duan

Process Description and Control

Threads. Thread Concept Multithreading Models User & Kernel Threads Pthreads Threads in Solaris, Linux, Windows. 2/13/11 CSE325 - Threads 1

Multi-Processor / Parallel Processing

Chap. 4 Multiprocessors and Thread-Level Parallelism

Lecture Topics. Announcements. Today: Advanced Scheduling (Stallings, chapter ) Next: Deadlock (Stallings, chapter

TYPES OF OPERATING SYSTEMS. Dimple Juneja

Lecture 9: MIMD Architectures

CSC 716 Advanced Operating System Fall 2007 Exam 1. Answer all the questions. The maximum credit for each question is as shown.

Processor Architecture and Interconnect

18-447: Computer Architecture Lecture 30B: Multiprocessors. Prof. Onur Mutlu Carnegie Mellon University Spring 2013, 4/22/2013

Course II Parallel Computer Architecture. Week 2-3 by Dr. Putu Harry Gunawan

Chapter 2 Operating System Overview

CS418 Operating Systems

Lecture 9: MIMD Architecture

The Multikernel: A new OS architecture for scalable multicore systems Baumann et al. Presentation: Mark Smith

Verteilte Systeme (Distributed Systems)

Multiprocessors and Thread-Level Parallelism. Department of Electrical & Electronics Engineering, Amrita School of Engineering

Unit OS2: Operating System Principles. Windows Operating System Internals - by David A. Solomon and Mark E. Russinovich with Andreas Polze

WHY PARALLEL PROCESSING? (CE-401)

POSIX in Real-Time. By Kevin M. Obenland 03/15/2001. Daniel Correia nºmec Carlos Guisado nºmec 49099

Parallel Computer Architectures. Lectured by: Phạm Trần Vũ Prepared by: Thoại Nam

ELEC 377 Operating Systems. Week 1 Class 2

Page 1. Analogy: Problems: Operating Systems Lecture 7. Operating Systems Lecture 7

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING UNIT-1

THREAD LEVEL PARALLELISM

Computer Architecture

Module 23: Windows NT. Windows NT

Computer Architecture Lecture 27: Multiprocessors. Prof. Onur Mutlu Carnegie Mellon University Spring 2015, 4/6/2015

Chapter 18. Parallel Processing. Yonsei University

Module 23: Windows NT

Lecture 9: MIMD Architectures

Lecture 5: Process Description and Control Multithreading Basics in Interprocess communication Introduction to multiprocessors

Module 21: Windows 2000

Module 21: Windows 2000

Operating Systems Overview. Chapter 2

Introduction to Parallel Computing

POSIX Threads: a first step toward parallel programming. George Bosilca

Chapter 4: Threads. Chapter 4: Threads. Overview Multicore Programming Multithreading Models Thread Libraries Implicit Threading Threading Issues

殷亚凤. Processes. Distributed Systems [3]

Chapter 11. Introduction to Multiprocessors

Chapter 4: Multithreaded Programming. Operating System Concepts 8 th Edition,

Computer and Information Sciences College / Computer Science Department CS 207 D. Computer Architecture. Lecture 9: Multiprocessors

Computer System Overview

Threads Assistant Professor DCS Operating System Concepts

Lect. 2: Types of Parallelism

Mac OS X. Mach in the Darwin Kernel. COMP342 4/5/06

Sistemas Operacionais I. Valeria Menezes Bastos

Transcription:

Operating System 4 THREADS, SMP AND MICROKERNELS

PROCESSES AND THREADS

Process concept characteristics discussed so far Resource ownership Scheduling/execution These two characteristics are independent. To distinguish the two characteristics, the unit of dispatching is usually referred to as a thread or lightweight process, while the unit of resource ownership is usually still referred to as a process or task.

Multithreading Ability of an OS to support multiple, concurrent paths of execution within a single proces

Thus, all of the threads of a process share the state and resources of that process. They reside in the same address space and have access to the same data. When one thread alters an item of data in memory, other threads see the results if and when they access that item. If one thread opens a file with read privileges, other threads in the same process can also read from that file.

Benefits of threads It takes far less time to create a new thread than to create a brand-new process. It takes less time to terminate a thread than a process It takes less time to switch between two threads within the same process than to switch between processes. Threads enhance efficiency in communication between different executing programs

Uses of threads Foreground and background work Asynchronous processing Speed of execution Modular program structure A significant issue is whether the blocking of a thread results in the blocking of the entire process. In other words, if one thread in a process is blocked, does this prevent the running of any other thread in the same process even if that other thread is in a ready state? See user-level versus kernel-level level threads

User-Level and Kernel-Level Threads There are two broad categories of thread implementation: userlevel threads (ULTs) and kernel-level threads (KLTs). The latter are also referred to in the literature as kernel-supported threads or lightweight processes

Advantages & Disadvantages of ULT Advantages of ULT than of KLT: Thread switching does not require kernel mode privileges. This saves the overhead of switches (user to kernel; kernel back to user). Scheduling can be application specific ULT can run on any OS Disadvantages of ULT: Many system calls are blocking. As a result, all of the threads within the process are blocked. In a pure ULT strategy, a multithreaded application cannot take advantage of multiprocessing.

In a pure KLT facility, all of the work of thread management is done by the kernel.there is no thread management code in the application level, simply an application programming interface (API) to the kernel thread facility. Windows is an example of this approach. The principal disadvantage of the KLT approach compared to the ULT approach is that the transfer of control from one thread to another within the same process requires a mode switch to the kernel. Combined Approach

SYMMETRIC MULTIPROCESSING

Single instruction single data (SISD) stream Single instruction multiple data (SIMD) stream Multiple instruction single data (MISD) stream Multiple instruction multiple data (MIMD) stream

Multiprocessor Operating System Design Considerations Simultaneous concurrent processes or threads: Kernel routines need to be reentrant to allow several processors to execute the same kernel code simultaneously. Scheduling: Scheduling may be performed by any processor, so conflicts must be avoided. Synchronization: With multiple active processes having potential access to shared address spaces or shared I/O resources, care must be taken to provide effective synchronization. Memory management: OS needs to exploit the available hardware parallelism, such as multiported memories Reliability and fault tolerance: The scheduler and other portions of the OS must recognize the loss of a processor and restructure management tables accordingly.

Microkernels

Microkernel Architecture A microkernel is a small OS core that provides the foundation for modular extensions. The term is somewhat fuzzy, however, and there are a number of questions The microkernel approach was popularized by its use in the Mach OS,which is now the core of the Macintosh Mac OS X operating system.

Benefits of a Microkernel Organization Uniform interfaces Extensibility Flexibility Portability Reliability Distributed system support Support for object-oriented operating systems (OOOSS)

A potential disadvantage of microkernels that is often cited is that of performance. It takes longer to build and send a message via the microkernel, and accept and decode the reply, than to make a single service call. One response to this problem was to enlarge the microkernel by reintegrating critical servers and drivers back into the OS. Increasing the functionality of the microkernel reduces the number of user-kernel mode switches and the number of address-space process switches. Another approach is to make the microkernel not larger but smaller. Example: second-generation microkernel is L4 which consists of 12 Kbytes of code and 7 system calls. Compared to 300 Kbytes of code and 140 system call interfaces.

WINDOWS THREAD AND SMP MANAGEMENT

Windows process design is driven by the need to provide support for a variety of OS environments. Processes supported by different OS environments differ in a number of ways, including the following: How processes are named Whether threads are provided within processes How processes are represented How process resources are protected What mechanisms are used for interprocess communication and synchronization How processes are related to each other

Thread Execution

Selesai...