Distributed Systems Operation System Support
|
|
- Malcolm Ellis
- 5 years ago
- Views:
Transcription
1 Hajussüsteemid MTAT Distributed Systems Operation System Support slides are adopted from: lecture: Operating System(OS) support (years 2016, 2017) book: Distributed Systems: Concepts and Design, Chapter 7 (Edn ) book: "Operating System Concepts, Ninth Edition ", Chapter 4 1/34
2 Outline Introduction Operating System Layers OS Kernel functionality Virtual Memory OS Process schedulers Threads 2/34
3 Introduction What is the main task of any operating system? 3/34
4 Introduction interface to hardware (CPU, memory, disk, network card, monitor) core services (file systems, network protocols,...) manage resources memory management (virtual memory, memory pages) CPU management (processes, threads) IO resources (sockets, opened files) share resources between processes process is a running program with its set of allocated resources protect processes from each other 4/34
5 Introduction What are the differences between: Network Operating System Distributed Operating System 5/34
6 Introduction What are the differences between: Network Operating System Distributed Operating System Network Operating System Built-in network capability Some resource accessible transparently Remote shell, remote desktop Network File systems (NFS, Samba ) Ssh, VNC, X11, Rdesktop... Still the concept is: Many interconnected physical nodes Many autonomous OS instances 6/34
7 Introduction What are the differences between: Network Operating System Distributed Operating System Distributed Operating System One Instance of Running OS Many interconnected physical nodes Are there any distributed OS nowadays? 7/34
8 Introduction What are the differences between: Network Operating System Distributed Operating System Distributed Operating System One Instance of Running OS Many interconnected physical nodes Are there any distributed OS nowadays? Why aren't they developed? 8/34
9 Introduction What are the differences between: Network Operating System Distributed Operating System Distributed Operating System One Instance of Running OS Many interconnected physical nodes Are there any distributed OS nowadays? Why aren't they developed? Software portability? Architecture complexity, hence lower performance? Users in fact want to preserve autonomy for their PCs! 9/34
10 Operating System Layers A code may be running in different Privilege levels: kernel level (tier 0) allows to access any resource, user level (tier 3) restricts access to resources System calls are kernel functions to be called from user level open() system call...returns a file descriptor, a small, nonnegative integer for use in subsequent system calls (read(2), write(2)... html Memory - the resource a program can access without syscall however, it does not access physical memory but virtual memory mapping from virtual to physical is still controlled from the kernel 10/34
11 Operating System Layers User-Space Applications, Services, Libraries Kernel-Space Process manager Memory manager, Thread manager Communication manager Supervisor 11/34
12 OS Kernel functionality 12/34
13 OS Kernel functionality Process manager: Creation of and operations upon processes. A process is a unit of resource management, including an address space and one or more threads. Thread manager: Thread creation, synchronization and scheduling. Threads are scheduled activities attached to processes Memory manager: Management of physical and virtual memory. Supervisor: Dispatching of interrupts, system call traps and other exceptions; control of memory management unit and hardware caches; processor and floating-point unit register manipulations. (hal32.dll, hal.dll?) 13/34
14 Virtual Memory Why is it called virtual? What in fact happens to the memory when the process is started? What is address space? What is fragmentation? What is paging? 14/34
15 Virtual Memory Every process has its address space e.g. address 42 on processes A and B is Address space is split into regions: text (code), stack, heap memory mapped files e.g. dynamic library (DLL) code *How by the way DLL is different from shared library shared memory regions try cat /proc/<pid>/maps Problem: fragmentation if P2 exits, can we fit something into the green region place in memory? solution: paging 15/34
16 Memory Pages mapping virtual (VM) to physical memory (PM) pages are 4kB (4MB) chunks process Page Table contains the mapping TLB cache speeds up translation allocating VM region does nothing to PM read/write results in page fault page fault handler decides what to do just allocate page in PM and update process page table load data for memory mapped files in case of low memory some pages are offloaded read-only mapped files can be discarded data pages are written into swap VIRT,RES and SHR in top 16/34
17 Processes and Treads Process? Thread? 17/34
18 Processes and Treads Process Unit of Resource Thread - Unit of Execution and Scheduling Detailed definition? Detailed definition? Kernel thread? User-level thread? Green-thread? Thread models (User-Level to Kernel Level) 18/34
19 Process Context What does the typical process consist of? 19/34
20 Process Context Typical process consists of: currently executing command (Program Counter) Stack Pointer (SP) general purpose registers, floating point registers memory management registers point to the information about process memory regions and page tables 20/34
21 Context switch Any ideas what is it? How does it work? Why is it said it is an expensive action? 21/34
22 Context switch Scheduler tries to run M processes on N cores gives each process time slice to execute Switching - can only be done in kernel (privileged) mode requires a system call pre-emptive: as the result of CPU hardware exception side effect of system call, e.g. in blocking in recv() store old process context find new process to execute (kernel contains list of processes) load new process context (where it left the last time) return to user mode TLB cache is invalidated (not with threads) CPU caches are also largely invalidated (unless threads reuse locality) All in all, it is pretty expensive action 22/34
23 Creating Process New processes are created with two system calls: fork() system call creates almost exact copy of the current process information about memory regions is copied page tables are copied however, physical pages are not copied immediately copy-on-write exeve() system call runs another program in the current process memory regions are cleared and replaced from the new executable new code, data, stack regions, opened files and libraries page tables are discarded new information is filled as the program is loaded into physical memory 23/34
24 Process Schedulers What is responsible for? For scheduling eventually :) But what exactly is it doing? What are different kinds of process schedulers? Regarding the number of CPUs or Cores in on CPU? Regarding the scheduling polices? 24/34
25 Process Schedulers Responsible for deciding if current process can continue or it should yield to the next process. Two kinds of schedulers exist Preemptive The decision is usually made based on events: Current process is in waiting state (it issued some blocking I/O request) Current process terminates A timer interrupt is invoking scheduler to put current process from running to ready state Blocking I/O operation is complete and the process may be put back into running state Cooperative scheduler cannot take the CPU away from a process Batch processing systems (run-to-completion) 25/34
26 Threads Traditional ( heavyweight ) processes have a single thread of control - There is one program counter, and one sequence of instructions that can be carried out at any given time. Multi-threaded applications have multiple threads within a single process, each having their own program counter, stack and set of registers, but sharing common code, data, and certain structures such as open files. 26/34
27 Threads 27/34
28 OS Threading Models There are two types of threads to be managed in a modern system: User-space threads and kernel threads. User-space threads are supported above the kernel, without kernel support. These are the threads that application programmers would put into their programs. Kernel threads are supported within the kernel of the OS itself. All modern OS-es support kernel level threads, allowing the kernel to perform multiple simultaneous tasks and/or to service multiple kernel system calls simultaneously. In a specific implementation, the user threads must be mapped to kernel threads, using one of the following strategies. 28/34
29 Many-To-One Model In the many-to-one model, many user-level threads are all mapped onto a single kernel thread. Thread management is handled by the thread library in user space, which is very efficient. However, if a blocking system call is made, then the entire process blocks, even if the other user threads would otherwise be able to continue. Because a single kernel thread can operate only on a single CPU, the many-to-one model does not allow individual processes to be split across multiple CPUs. Green threads for Solaris and GNU Portable Threads implement the many-to-one model in the past, but few systems continue to do so today. 29/34
30 One-To-One Model The one-to-one model creates a separate kernel thread to handle each user thread. One-to-one model overcomes the problems listed above involving blocking system calls and the splitting of processes across multiple CPUs. However the overhead of managing the one-toone model is more significant, involving more overhead and slowing down the system. Most implementations of this model place a limit on how many threads can be created. Linux and Windows from 95 to XP implement the one-to-one model for threads 30/34
31 Many-To-Many Model The many-to-many model multiplexes any number of user threads onto an equal or smaller number of kernel threads, combining the best features of the one-to-one and many-to-one models. Users have no restrictions on the number of threads created. Blocking kernel system calls do not block the entire process. Processes can be split across multiple processors. Individual processes may be allocated variable numbers of kernel threads, depending on the number of CPUs present and other factors. 31/34
32 Two-tier model is the two-tier model, which allows either manyto-many or one-to-one operation. IRIX, HP-UX, and Tru64 UNIX use the two-tier model, as did Solaris prior to Solaris 9. 32/34
33 Threads Libraries POSIX Threads or Pthreads The POSIX standard ( IEEE c ) defines the specification for pthreads, not the implementation. pthreads are available on Solaris, Linux, Mac OSX, Tru64, and via public domain shareware for Windows. Global variables are shared amongst all threads. Windows Threads Similar to pthreads, just the API is different Java Threads JVM runs on top of a native OS, and that the JVM specification does not specify what model to use for mapping Java threads to kernel threads. This decision is JVM implementation dependent, and may be one-to-one, many-to-many, or many to one.. What about Python Threads? What does it in fact using? And what model? 33/34
34 Read at Home Read / work through the Textbook Chapter 8 -- Distributed objects and components Some questions to address: 1. What are the key differences in objects and distributed objects? 2. What are the key concepts of CORBA? 3. What are the issues with object-oriented middle-ware? 4. What has the concept of software components in offer to overcome these issues? 34/34
35 Hajussüsteemid MTAT Distributed Systems Operation System Support slides are adopted from: lecture: Operating System(OS) support (years 2016, 2017) book: Distributed Systems: Concepts and Design, Chapter 7 (Edn ) book: "Operating System Concepts, Ninth Edition ", Chapter 4 1/34
36 Outline Introduction Operating System Layers OS Kernel functionality Virtual Memory OS Process schedulers Threads 2/34
37 Introduction What is the main task of any operating system? 3/34
38 Introduction interface to hardware (CPU, memory, disk, network card, monitor) core services (file systems, network protocols,...) manage resources memory management (virtual memory, memory pages) CPU management (processes, threads) IO resources (sockets, opened files) share resources between processes process is a running program with its set of allocated resources protect processes from each other 4/34
39 Introduction What are the differences between: Network Operating System Distributed Operating System 5/34
40 Introduction What are the differences between: Network Operating System Distributed Operating System Network Operating System Built-in network capability Some resource accessible transparently Network File systems (NFS, Samba ) Remote shell, remote desktop Ssh, VNC, X11, Rdesktop... Still the concept is: Many interconnected physical nodes Many autonomous OS instances 6/34
41 Introduction What are the differences between: Network Operating System Distributed Operating System Distributed Operating System One Instance of Running OS Many interconnected physical nodes Are there any distributed OS nowadays? 7/34
42 Introduction What are the differences between: Network Operating System Distributed Operating System Distributed Operating System One Instance of Running OS Many interconnected physical nodes Are there any distributed OS nowadays? Why aren't they developed? 8/34
43 Introduction What are the differences between: Network Operating System Distributed Operating System Distributed Operating System One Instance of Running OS Many interconnected physical nodes Are there any distributed OS nowadays? Why aren't they developed? Software portability? Architecture complexity, hence lower performance? Users in fact want to preserve autonomy for their PCs! 9/34
44 Operating System Layers A code may be running in different Privilege levels: kernel level (tier 0) allows to access any resource, user level (tier 3) restricts access to resources System calls are kernel functions to be called from user level open() system call...returns a file descriptor, a small, nonnegative integer for use in subsequent system calls (read(2), write(2)... html Memory - the resource a program can access without syscall however, it does not access physical memory but virtual memory mapping from virtual to physical is still controlled from the kernel 10/34
45 Operating System Layers User-Space Applications, Services, Libraries Kernel-Space Process manager Memory manager, Thread manager Communication manager Supervisor 11/34
46 OS Kernel functionality 12/34
47 OS Kernel functionality Process manager: Creation of and operations upon processes. A process is a unit of resource management, including an address space and one or more threads. Thread manager: Thread creation, synchronization and scheduling. Threads are scheduled activities attached to processes Memory manager: Management of physical and virtual memory. Supervisor: Dispatching of interrupts, system call traps and other exceptions; control of memory management unit and hardware caches; processor and floating-point unit register manipulations. (hal32.dll, hal.dll?) 13/34
48 Virtual Memory Why is it called virtual? What in fact happens to the memory when the process is started? What is address space? What is fragmentation? What is paging? 14/34
49 Virtual Memory Every process has its address space e.g. address 42 on processes A and B is Address space is split into regions: text (code), stack, heap memory mapped files e.g. dynamic library (DLL) code *How by the way DLL is different from shared library shared memory regions try cat /proc/<pid>/maps Problem: fragmentation if P2 exits, can we fit something into the green region place in memory? solution: paging 15/34
50 Memory Pages mapping virtual (VM) to physical memory (PM) pages are 4kB (4MB) chunks process Page Table contains the mapping TLB cache speeds up translation allocating VM region does nothing to PM read/write results in page fault page fault handler decides what to do just allocate page in PM and update process page table load data for memory mapped files in case of low memory some pages are offloaded read-only mapped files can be discarded data pages are written into swap VIRT,RES and SHR in top 16/34
51 Processes and Treads Process? Thread? 17/34
52 Processes and Treads Process Unit of Resource Thread - Unit of Execution and Scheduling Detailed definition? Detailed definition? Kernel thread? User-level thread? Green-thread? Thread models (User-Level to Kernel Level) 18/34
53 Process Context What does the typical process consist of? 19/34
54 Process Context Typical process consists of: currently executing command (Program Counter) Stack Pointer (SP) general purpose registers, floating point registers memory management registers point to the information about process memory regions and page tables 20/34
55 Context switch Any ideas what is it? How does it work? Why is it said it is an expensive action? 21/34
56 Context switch Scheduler tries to run M processes on N cores gives each process time slice to execute Switching - can only be done in kernel (privileged) mode requires a system call pre-emptive: as the result of CPU hardware exception side effect of system call, e.g. in blocking in recv() store old process context find new process to execute (kernel contains list of processes) load new process context (where it left the last time) return to user mode TLB cache is invalidated (not with threads) CPU caches are also largely invalidated (unless threads reuse locality) All in all, it is pretty expensive action 22/34
57 Creating Process New processes are created with two system calls: fork() system call creates almost exact copy of the current process information about memory regions is copied page tables are copied however, physical pages are not copied immediately copy-on-write exeve() system call runs another program in the current process memory regions are cleared and replaced from the new executable new code, data, stack regions, opened files and libraries page tables are discarded new information is filled as the program is loaded into physical memory 23/34
58 Process Schedulers What is responsible for? For scheduling eventually :) But what exactly is it doing? What are different kinds of process schedulers? Regarding the number of CPUs or Cores in on CPU? Regarding the scheduling polices? 24/34
59 Process Schedulers Responsible for deciding if current process can continue or it should yield to the next process. Two kinds of schedulers exist Preemptive The decision is usually made based on events: Current process is in waiting state (it issued some blocking I/O request) Current process terminates A timer interrupt is invoking scheduler to put current process from running to ready state Blocking I/O operation is complete and the process may be put back into running state Cooperative scheduler cannot take the CPU away from a process Batch processing systems (run-to-completion) 25/34
60 Threads Traditional ( heavyweight ) processes have a single thread of control - There is one program counter, and one sequence of instructions that can be carried out at any given time. Multi-threaded applications have multiple threads within a single process, each having their own program counter, stack and set of registers, but sharing common code, data, and certain structures such as open files. 26/34
61 Threads 27/34
62 OS Threading Models There are two types of threads to be managed in a modern system: User-space threads and kernel threads. User-space threads are supported above the kernel, without kernel support. These are the threads that application programmers would put into their programs. Kernel threads are supported within the kernel of the OS itself. All modern OS-es support kernel level threads, allowing the kernel to perform multiple simultaneous tasks and/or to service multiple kernel system calls simultaneously. In a specific implementation, the user threads must be mapped to kernel threads, using one of the following strategies. 28/34
63 Many-To-One Model In the many-to-one model, many user-level threads are all mapped onto a single kernel thread. Thread management is handled by the thread library in user space, which is very efficient. However, if a blocking system call is made, then the entire process blocks, even if the other user threads would otherwise be able to continue. Because a single kernel thread can operate only on a single CPU, the many-to-one model does not allow individual processes to be split across multiple CPUs. Green threads for Solaris and GNU Portable Threads implement the many-to-one model in the past, but few systems continue to do so today. 29/34
64 One-To-One Model The one-to-one model creates a separate kernel thread to handle each user thread. One-to-one model overcomes the problems listed above involving blocking system calls and the splitting of processes across multiple CPUs. However the overhead of managing the one-toone model is more significant, involving more overhead and slowing down the system. Most implementations of this model place a limit on how many threads can be created. Linux and Windows from 95 to XP implement the one-to-one model for threads 30/34
65 Many-To-Many Model The many-to-many model multiplexes any number of user threads onto an equal or smaller number of kernel threads, combining the best features of the one-to-one and many-to-one models. Users have no restrictions on the number of threads created. Blocking kernel system calls do not block the entire process. Processes can be split across multiple processors. Individual processes may be allocated variable numbers of kernel threads, depending on the number of CPUs present and other factors. 31/34
66 Two-tier model is the two-tier model, which allows either manyto-many or one-to-one operation. IRIX, HP-UX, and Tru64 UNIX use the two-tier model, as did Solaris prior to Solaris 9. 32/34
67 Threads Libraries POSIX Threads or Pthreads The POSIX standard ( IEEE c ) defines the specification for pthreads, not the implementation. pthreads are available on Solaris, Linux, Mac OSX, Tru64, and via public domain shareware for Windows. Global variables are shared amongst all threads. Windows Threads Similar to pthreads, just the API is different Java Threads JVM runs on top of a native OS, and that the JVM specification does not specify what model to use for mapping Java threads to kernel threads. This decision is JVM implementation dependent, and may be one-to-one, many-to-many, or many to one.. What about Python Threads? What does it in fact using? And what model? 33/34
68 Read at Home Read / work through the Textbook Chapter 8 -- Distributed objects and components Some questions to address: 1. What are the key differences in objects and distributed objects? 2. What are the key concepts of CORBA? 3. What are the issues with object-oriented middle-ware? 4. What has the concept of software components in offer to overcome these issues? 34/34
Chapter 4: Threads. Overview Multithreading Models Thread Libraries Threading Issues Operating System Examples Windows XP Threads Linux Threads
Chapter 4: Threads Overview Multithreading Models Thread Libraries Threading Issues Operating System Examples Windows XP Threads Linux Threads Chapter 4: Threads Objectives To introduce the notion of a
More informationChapter 4: Multithreaded Programming. Operating System Concepts 8 th Edition,
Chapter 4: Multithreaded Programming, Silberschatz, Galvin and Gagne 2009 Chapter 4: Multithreaded Programming Overview Multithreading Models Thread Libraries Threading Issues 4.2 Silberschatz, Galvin
More informationOutline. Threads. Single and Multithreaded Processes. Benefits of Threads. Eike Ritter 1. Modified: October 16, 2012
Eike Ritter 1 Modified: October 16, 2012 Lecture 8: Operating Systems with C/C++ School of Computer Science, University of Birmingham, UK 1 Based on material by Matt Smart and Nick Blundell Outline 1 Concurrent
More informationI.-C. Lin, Assistant Professor. Textbook: Operating System Concepts 8ed CHAPTER 4: MULTITHREADED PROGRAMMING
I.-C. Lin, Assistant Professor. Textbook: Operating System Concepts 8ed CHAPTER 4: MULTITHREADED PROGRAMMING Chapter 4: Multithreaded Programming Overview Multithreading Models Thread Libraries Threading
More informationProcess Description and Control
Process Description and Control 1 Process:the concept Process = a program in execution Example processes: OS kernel OS shell Program executing after compilation www-browser Process management by OS : Allocate
More informationChapter 4: Multi-Threaded Programming
Chapter 4: Multi-Threaded Programming Chapter 4: Threads 4.1 Overview 4.2 Multicore Programming 4.3 Multithreading Models 4.4 Thread Libraries Pthreads Win32 Threads Java Threads 4.5 Implicit Threading
More informationChapter 4: Threads. Operating System Concepts 8 th Edition,
Chapter 4: Threads, Silberschatz, Galvin and Gagne 2009 Chapter 4: Threads Overview Multithreading Models Thread Libraries 4.2 Silberschatz, Galvin and Gagne 2009 Objectives To introduce the notion of
More informationChapter 5: Threads. Overview Multithreading Models Threading Issues Pthreads Windows XP Threads Linux Threads Java Threads
Chapter 5: Threads Overview Multithreading Models Threading Issues Pthreads Windows XP Threads Linux Threads Java Threads 5.1 Silberschatz, Galvin and Gagne 2003 More About Processes A process encapsulates
More informationThreads Implementation. Jo, Heeseung
Threads Implementation Jo, Heeseung Today's Topics How to implement threads? User-level threads Kernel-level threads Threading models 2 Kernel/User-level Threads Who is responsible for creating/managing
More informationChapter 4: Threads. Overview Multithreading Models Threading Issues Pthreads Windows XP Threads Linux Threads Java Threads. Operating System Concepts
Chapter 4: Threads Chapter 4: Threads Overview Multithreading Models Threading Issues Pthreads Windows XP Threads Linux Threads Java Threads 4.2 Silberschatz, Galvin and Gagne 2005 Single and Multithreaded
More informationCS420: Operating Systems
Threads James Moscola Department of Physical Sciences York College of Pennsylvania Based on Operating System Concepts, 9th Edition by Silberschatz, Galvin, Gagne Threads A thread is a basic unit of processing
More informationLecture 2 Process Management
Lecture 2 Process Management Process Concept An operating system executes a variety of programs: Batch system jobs Time-shared systems user programs or tasks The terms job and process may be interchangeable
More informationProcesses and Threads
TDDI04 Concurrent Programming, Operating Systems, and Real-time Operating Systems Processes and Threads [SGG7] Chapters 3 and 4 Copyright Notice: The lecture notes are mainly based on Silberschatz s, Galvin
More informationOPERATING SYSTEM. Chapter 4: Threads
OPERATING SYSTEM Chapter 4: Threads Chapter 4: Threads Overview Multicore Programming Multithreading Models Thread Libraries Implicit Threading Threading Issues Operating System Examples Objectives To
More informationThreads. CS3026 Operating Systems Lecture 06
Threads CS3026 Operating Systems Lecture 06 Multithreading Multithreading is the ability of an operating system to support multiple threads of execution within a single process Processes have at least
More informationLast Class: CPU Scheduling. Pre-emptive versus non-preemptive schedulers Goals for Scheduling: CS377: Operating Systems.
Last Class: CPU Scheduling Pre-emptive versus non-preemptive schedulers Goals for Scheduling: Minimize average response time Maximize throughput Share CPU equally Other goals? Scheduling Algorithms: Selecting
More informationThreads Implementation. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University
Threads Implementation Jin-Soo Kim (jinsookim@skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu Today s Topics How to implement threads? User-level threads Kernel-level
More informationChapter 4: Threads. Chapter 4: Threads
Chapter 4: Threads Silberschatz, Galvin and Gagne 2009 Chapter 4: Threads Overview Multithreading Models Thread Libraries Threading Issues Operating System Examples Windows XP Threads Linux Threads 4.2
More informationLecture 4: Mechanism of process execution. Mythili Vutukuru IIT Bombay
Lecture 4: Mechanism of process execution Mythili Vutukuru IIT Bombay Low-level mechanisms How does the OS run a process? How does it handle a system call? How does it context switch from one process to
More informationChapter 4: Multithreaded Programming
Chapter 4: Multithreaded Programming Silberschatz, Galvin and Gagne 2013! Chapter 4: Multithreaded Programming Overview Multicore Programming Multithreading Models Threading Issues Operating System Examples
More informationMotivation. Threads. Multithreaded Server Architecture. Thread of execution. Chapter 4
Motivation Threads Chapter 4 Most modern applications are multithreaded Threads run within application Multiple tasks with the application can be implemented by separate Update display Fetch data Spell
More informationCS307: Operating Systems
CS307: Operating Systems Chentao Wu 吴晨涛 Associate Professor Dept. of Computer Science and Engineering Shanghai Jiao Tong University SEIEE Building 3-513 wuct@cs.sjtu.edu.cn Download Lectures ftp://public.sjtu.edu.cn
More informationChapter 5: Processes & Process Concept. Objectives. Process Concept Process Scheduling Operations on Processes. Communication in Client-Server Systems
Chapter 5: Processes Chapter 5: Processes & Threads Process Concept Process Scheduling Operations on Processes Interprocess Communication Communication in Client-Server Systems, Silberschatz, Galvin and
More informationChapter 4: Multithreaded
Chapter 4: Multithreaded Programming Chapter 4: Multithreaded Programming Overview Multithreading Models Thread Libraries Threading Issues Operating-System Examples 2009/10/19 2 4.1 Overview A thread is
More informationQuestions answered in this lecture: CS 537 Lecture 19 Threads and Cooperation. What s in a process? Organizing a Process
Questions answered in this lecture: CS 537 Lecture 19 Threads and Cooperation Why are threads useful? How does one use POSIX pthreads? Michael Swift 1 2 What s in a process? Organizing a Process A process
More informationCS 450 Operating System Week 4 Lecture Notes
CS 450 Operating System Week 4 Lecture Notes Reading: Operating System Concepts (7 th Edition) - Silberschatz, Galvin, Gagne Chapter 5 - Pages 129 147 Objectives: 1. Explain the main Objective of Threads
More informationMultithreaded Programming
Multithreaded Programming The slides do not contain all the information and cannot be treated as a study material for Operating System. Please refer the text book for exams. September 4, 2014 Topics Overview
More informationChe-Wei Chang Department of Computer Science and Information Engineering, Chang Gung University
Che-Wei Chang chewei@mail.cgu.edu.tw Department of Computer Science and Information Engineering, Chang Gung University 1. Introduction 2. System Structures 3. Process Concept 4. Multithreaded Programming
More informationThreads. Raju Pandey Department of Computer Sciences University of California, Davis Spring 2011
Threads Raju Pandey Department of Computer Sciences University of California, Davis Spring 2011 Threads Effectiveness of parallel computing depends on the performance of the primitives used to express
More informationMemory Management. Disclaimer: some slides are adopted from book authors slides with permission 1
Memory Management Disclaimer: some slides are adopted from book authors slides with permission 1 CPU management Roadmap Process, thread, synchronization, scheduling Memory management Virtual memory Disk
More informationChapter 4: Threads. Chapter 4: Threads. Overview Multicore Programming Multithreading Models Thread Libraries Implicit Threading Threading Issues
Chapter 4: Threads Silberschatz, Galvin and Gagne 2013 Chapter 4: Threads Overview Multicore Programming Multithreading Models Thread Libraries Implicit Threading Threading Issues 4.2 Silberschatz, Galvin
More informationChapter 4: Multithreaded Programming Dr. Varin Chouvatut. Operating System Concepts 8 th Edition,
Chapter 4: Multithreaded Programming Dr. Varin Chouvatut, Silberschatz, Galvin and Gagne 2010 Chapter 4: Multithreaded Programming Overview Multithreading Models Thread Libraries Threading Issues Operating
More informationThreads. CS-3013 Operating Systems Hugh C. Lauer. CS-3013, C-Term 2012 Threads 1
Threads CS-3013 Operating Systems Hugh C. Lauer (Slides include materials from Slides include materials from Modern Operating Systems, 3 rd ed., by Andrew Tanenbaum and from Operating System Concepts,
More informationChapter 4: Threads. Chapter 4: Threads
Chapter 4: Threads Silberschatz, Galvin and Gagne 2013 Chapter 4: Threads Overview Multicore Programming Multithreading Models Thread Libraries Implicit Threading Threading Issues Operating System Examples
More informationLast 2 Classes: Introduction to Operating Systems & C++ tutorial. Today: OS and Computer Architecture
Last 2 Classes: Introduction to Operating Systems & C++ tutorial User apps OS Virtual machine interface hardware physical machine interface An operating system is the interface between the user and the
More informationCHAPTER 2: PROCESS MANAGEMENT
1 CHAPTER 2: PROCESS MANAGEMENT Slides by: Ms. Shree Jaswal TOPICS TO BE COVERED Process description: Process, Process States, Process Control Block (PCB), Threads, Thread management. Process Scheduling:
More informationMemory Management. Disclaimer: some slides are adopted from book authors slides with permission 1
Memory Management Disclaimer: some slides are adopted from book authors slides with permission 1 Recap Paged MMU: Two main Issues Translation speed can be slow TLB Table size is big Multi-level page table
More informationPage 1. Analogy: Problems: Operating Systems Lecture 7. Operating Systems Lecture 7
Os-slide#1 /*Sequential Producer & Consumer*/ int i=0; repeat forever Gather material for item i; Produce item i; Use item i; Discard item i; I=I+1; end repeat Analogy: Manufacturing and distribution Print
More informationChapter 4 Multithreaded Programming
Chapter 4 Multithreaded Programming Da-Wei Chang CSIE.NCKU Source: Abraham Silberschatz, Peter B. Galvin, and Greg Gagne, "Operating System Concepts", 9th Edition, Wiley. 1 1 Outline Overview Multithreading
More informationYi Shi Fall 2017 Xi an Jiaotong University
Threads Yi Shi Fall 2017 Xi an Jiaotong University Goals for Today Case for Threads Thread details Case for Parallelism main() read_data() for(all data) compute(); write_data(); endfor main() read_data()
More informationCSE 4/521 Introduction to Operating Systems
CSE 4/521 Introduction to Operating Systems Lecture 5 Threads (Overview, Multicore Programming, Multithreading Models, Thread Libraries, Implicit Threading, Operating- System Examples) Summer 2018 Overview
More informationICS Principles of Operating Systems
ICS 143 - Principles of Operating Systems Lectures 3 and 4 - Processes and Threads Prof. Nalini Venkatasubramanian nalini@ics.uci.edu Some slides adapted from http://www-inst.eecs.berkeley.edu/~cs162/
More informationLast Class: OS and Computer Architecture. Last Class: OS and Computer Architecture
Last Class: OS and Computer Architecture System bus Network card CPU, memory, I/O devices, network card, system bus Lecture 4, page 1 Last Class: OS and Computer Architecture OS Service Protection Interrupts
More informationCSCE 313 Introduction to Computer Systems. Instructor: Dezhen Song
CSCE 313 Introduction to Computer Systems Instructor: Dezhen Song Programs, Processes, and Threads Programs and Processes Threads Programs, Processes, and Threads Programs and Processes Threads Processes
More informationChapter 4: Threads. Operating System Concepts. Silberschatz, Galvin and Gagne
Chapter 4: Threads Silberschatz, Galvin and Gagne Chapter 4: Threads Overview Multithreading Models Thread Libraries Threading Issues Operating System Examples Linux Threads 4.2 Silberschatz, Galvin and
More informationWhat s in a process?
CSE 451: Operating Systems Winter 2015 Module 5 Threads Mark Zbikowski mzbik@cs.washington.edu Allen Center 476 2013 Gribble, Lazowska, Levy, Zahorjan What s in a process? A process consists of (at least):
More informationCISC2200 Threads Spring 2015
CISC2200 Threads Spring 2015 Process We learn the concept of process A program in execution A process owns some resources A process executes a program => execution state, PC, We learn that bash creates
More informationCSCE 313: Intro to Computer Systems
CSCE 313 Introduction to Computer Systems Instructor: Dr. Guofei Gu http://courses.cse.tamu.edu/guofei/csce313/ Programs, Processes, and Threads Programs and Processes Threads 1 Programs, Processes, and
More informationTDIU25: Operating Systems II. Processes, Threads and Scheduling
TDIU25: Operating Systems II. Processes, Threads and Scheduling SGG9: 3.1-3.3, 4.1-4.3, 5.1-5.4 o Process concept: context switch, scheduling queues, creation o Multithreaded programming o Process scheduling
More informationThreads. Thread Concept Multithreading Models User & Kernel Threads Pthreads Threads in Solaris, Linux, Windows. 2/13/11 CSE325 - Threads 1
Threads Thread Concept Multithreading Models User & Kernel Threads Pthreads Threads in Solaris, Linux, Windows 2/13/11 CSE325 - Threads 1 Threads The process concept incorporates two abstractions: a virtual
More informationChapter 5: Threads. Outline
Department of Electr rical Eng ineering, Chapter 5: Threads 王振傑 (Chen-Chieh Wang) ccwang@mail.ee.ncku.edu.tw ncku edu Feng-Chia Unive ersity Outline Overview Multithreading Models Threading Issues 2 Depar
More informationProcesses and Non-Preemptive Scheduling. Otto J. Anshus
Processes and Non-Preemptive Scheduling Otto J. Anshus Threads Processes Processes Kernel An aside on concurrency Timing and sequence of events are key concurrency issues We will study classical OS concurrency
More informationProcesses and Threads
Processes and Threads Giuseppe Anastasi g.anastasi@iet.unipi.it Pervasive Computing & Networking Lab. () Dept. of Information Engineering, University of Pisa Based on original slides by Silberschatz, Galvin
More informationLecture 5: Process Description and Control Multithreading Basics in Interprocess communication Introduction to multiprocessors
Lecture 5: Process Description and Control Multithreading Basics in Interprocess communication Introduction to multiprocessors 1 Process:the concept Process = a program in execution Example processes:
More informationWhat s in a traditional process? Concurrency/Parallelism. What s needed? CSE 451: Operating Systems Autumn 2012
What s in a traditional process? CSE 451: Operating Systems Autumn 2012 Ed Lazowska lazowska @cs.washi ngton.edu Allen Center 570 A process consists of (at least): An, containing the code (instructions)
More informationNotes. CS 537 Lecture 5 Threads and Cooperation. Questions answered in this lecture: What s in a process?
Notes CS 537 Lecture 5 Threads and Cooperation Michael Swift OS news MS lost antitrust in EU: harder to integrate features Quiz tomorrow on material from chapters 2 and 3 in the book Hardware support for
More informationCS 475. Process = Address space + one thread of control Concurrent program = multiple threads of control
Processes & Threads Concurrent Programs Process = Address space + one thread of control Concurrent program = multiple threads of control Multiple single-threaded processes Multi-threaded process 2 1 Concurrent
More informationCSE 120 Principles of Operating Systems
CSE 120 Principles of Operating Systems Spring 2018 Lecture 10: Paging Geoffrey M. Voelker Lecture Overview Today we ll cover more paging mechanisms: Optimizations Managing page tables (space) Efficient
More informationLast time: introduction. Networks and Operating Systems ( ) Chapter 2: Processes. This time. General OS structure. The kernel is a program!
ADRIAN PERRIG & TORSTEN HOEFLER Networks and Operating Systems (252-0062-00) Chapter 2: Processes Last time: introduction Introduction: Why? February 12, 2016 Roles of the OS Referee Illusionist Glue Structure
More information10/10/ Gribble, Lazowska, Levy, Zahorjan 2. 10/10/ Gribble, Lazowska, Levy, Zahorjan 4
What s in a process? CSE 451: Operating Systems Autumn 2010 Module 5 Threads Ed Lazowska lazowska@cs.washington.edu Allen Center 570 A process consists of (at least): An, containing the code (instructions)
More informationChapter 3: Processes. Operating System Concepts 8th Edition
Chapter 3: Processes Chapter 3: Processes Process Concept Process Scheduling Operations on Processes Interprocess Communication Examples of IPC Systems Communication in Client-Server Systems 3.2 Objectives
More informationThreads. What is a thread? Motivation. Single and Multithreaded Processes. Benefits
CS307 What is a thread? Threads A thread is a basic unit of CPU utilization contains a thread ID, a program counter, a register set, and a stack shares with other threads belonging to the same process
More informationCSE 120 Principles of Operating Systems
CSE 120 Principles of Operating Systems Spring 2009 Lecture 4: Threads Geoffrey M. Voelker Announcements Homework #1 due now Project 0 due tonight Project 1 out April 9, 2009 CSE 120 Lecture 4 Threads
More informationOperating Systems CMPSCI 377 Spring Mark Corner University of Massachusetts Amherst
Operating Systems CMPSCI 377 Spring 2017 Mark Corner University of Massachusetts Amherst Last Class: Intro to OS An operating system is the interface between the user and the architecture. User-level Applications
More informationCS Lecture 3! Threads! George Mason University! Spring 2010!
CS 571 - Lecture 3! Threads! George Mason University! Spring 2010! Threads! Overview! Multithreading! Example Applications! User-level Threads! Kernel-level Threads! Hybrid Implementation! Observing Threads!
More informationLecture 2 - Fundamental Concepts
Lecture 2 - Fundamental Concepts Instructor : Bibhas Ghoshal (bibhas.ghoshal@iiita.ac.in) Autumn Semester, 2015 Bibhas Ghoshal IOSY 332C & IOPS 332C: OS Autumn Semester, 2015 1 / 43 Lecture Outline Operating
More informationMemory Management. Disclaimer: some slides are adopted from book authors slides with permission 1
Memory Management Disclaimer: some slides are adopted from book authors slides with permission 1 Demand paging Concepts to Learn 2 Abstraction Virtual Memory (VM) 4GB linear address space for each process
More informationCSE 120 Principles of Operating Systems
CSE 120 Principles of Operating Systems Fall 2015 Lecture 4: Threads Geoffrey M. Voelker Announcements Project 0 due Project 1 out October 6, 2015 CSE 120 Lecture 4 Threads 2 Processes Recall that a process
More informationLecture 13: Address Translation
CS 422/522 Design & Implementation of Operating Systems Lecture 13: Translation Zhong Shao Dept. of Computer Science Yale University Acknowledgement: some slides are taken from previous versions of the
More informationOperating System Architecture. CS3026 Operating Systems Lecture 03
Operating System Architecture CS3026 Operating Systems Lecture 03 The Role of an Operating System Service provider Provide a set of services to system users Resource allocator Exploit the hardware resources
More informationChapter 4: Multithreaded Programming
Chapter 4: Multithreaded Programming Silberschatz, Galvin and Gagne 2013 Chapter 4: Multithreaded Programming Overview Multicore Programming Multithreading Models Thread Libraries Implicit Threading Threading
More informationChapter 3 Process Description and Control
Operating Systems: Internals and Design Principles Chapter 3 Process Description and Control Seventh Edition By William Stallings Process Control Block Structure of Process Images in Virtual Memory How
More informationOperating System Services
CSE325 Principles of Operating Systems Operating System Services David Duggan dduggan@sandia.gov January 22, 2013 Reading Assignment 3 Chapter 3, due 01/29 1/23/13 CSE325 - OS Services 2 What Categories
More information3. Process Management in xv6
Lecture Notes for CS347: Operating Systems Mythili Vutukuru, Department of Computer Science and Engineering, IIT Bombay 3. Process Management in xv6 We begin understanding xv6 process management by looking
More informationCPSC 341 OS & Networks. Introduction. Dr. Yingwu Zhu
CPSC 341 OS & Networks Introduction Dr. Yingwu Zhu What to learn? Concepts Processes, threads, multi-processing, multithreading, synchronization, deadlocks, CPU scheduling, networks, security Practice:
More informationLecture 17: Threads and Scheduling. Thursday, 05 Nov 2009
CS211: Programming and Operating Systems Lecture 17: Threads and Scheduling Thursday, 05 Nov 2009 CS211 Lecture 17: Threads and Scheduling 1/22 Today 1 Introduction to threads Advantages of threads 2 User
More informationProcesses and More. CSCI 315 Operating Systems Design Department of Computer Science
Processes and More CSCI 315 Operating Systems Design Department of Computer Science Notice: The slides for this lecture have been largely based on those accompanying the textbook Operating Systems Concepts,
More informationXen and the Art of Virtualization. CSE-291 (Cloud Computing) Fall 2016
Xen and the Art of Virtualization CSE-291 (Cloud Computing) Fall 2016 Why Virtualization? Share resources among many uses Allow heterogeneity in environments Allow differences in host and guest Provide
More informationTHE PROCESS ABSTRACTION. CS124 Operating Systems Winter , Lecture 7
THE PROCESS ABSTRACTION CS124 Operating Systems Winter 2015-2016, Lecture 7 2 The Process Abstraction Most modern OSes include the notion of a process Term is short for a sequential process Frequently
More informationCS 326: Operating Systems. Process Execution. Lecture 5
CS 326: Operating Systems Process Execution Lecture 5 Today s Schedule Process Creation Threads Limited Direct Execution Basic Scheduling 2/5/18 CS 326: Operating Systems 2 Today s Schedule Process Creation
More informationProcess and Its Image An operating system executes a variety of programs: A program that browses the Web A program that serves Web requests
Recap of the Last Class System protection and kernel mode System calls and the interrupt interface Processes Process concept A process s image in a computer Operations on processes Context switches and
More informationProcesses. Process Management Chapter 3. When does a process gets created? When does a process gets terminated?
Processes Process Management Chapter 3 1 A process is a program in a state of execution (created but not terminated) Program is a passive entity one on your disk (survivor.class, kelly.out, ) Process is
More informationEECS 3221 Operating System Fundamentals
EECS 3221 Operating System Fundamentals Instructor: Prof. Hui Jiang Email: hj@cse.yorku.ca Web: http://www.eecs.yorku.ca/course/3221 General Info 3 lecture hours each week 2 assignments (2*5%=10%) 1 project
More informationEECS 3221 Operating System Fundamentals
General Info EECS 3221 Operating System Fundamentals Instructor: Prof. Hui Jiang Email: hj@cse.yorku.ca Web: http://www.eecs.yorku.ca/course/3221 3 lecture hours each week 2 assignments (2*5%=10%) 1 project
More informationThreads. Still Chapter 2 (Based on Silberchatz s text and Nachos Roadmap.) 3/9/2003 B.Ramamurthy 1
Threads Still Chapter 2 (Based on Silberchatz s text and Nachos Roadmap.) 3/9/2003 B.Ramamurthy 1 Single and Multithreaded Processes Thread specific Data (TSD) Code 3/9/2003 B.Ramamurthy 2 User Threads
More informationRicardo Rocha. Department of Computer Science Faculty of Sciences University of Porto
Ricardo Rocha Department of Computer Science Faculty of Sciences University of Porto Slides based on the book Operating System Concepts, 9th Edition, Abraham Silberschatz, Peter B. Galvin and Greg Gagne,
More informationOperating-System Structures
Operating-System Structures Chapter 2 Operating System Services One set provides functions that are helpful to the user: User interface Program execution I/O operations File-system manipulation Communications
More informationLecture 4: Threads; weaving control flow
Lecture 4: Threads; weaving control flow CSE 120: Principles of Operating Systems Alex C. Snoeren HW 1 Due NOW Announcements Homework #1 due now Project 0 due tonight Project groups Please send project
More informationInf2C - Computer Systems Lecture 16 Exceptions and Processor Management
Inf2C - Computer Systems Lecture 16 Exceptions and Processor Management Boris Grot School of Informatics University of Edinburgh Class party! When: Friday, Dec 1 @ 8pm Where: Bar 50 on Cowgate Inf2C Computer
More informationToday s Topics. u Thread implementation. l Non-preemptive versus preemptive threads. l Kernel vs. user threads
Today s Topics COS 318: Operating Systems Implementing Threads u Thread implementation l Non-preemptive versus preemptive threads l Kernel vs. user threads Jaswinder Pal Singh and a Fabulous Course Staff
More informationTDDI04, K. Arvidsson, IDA, Linköpings universitet Operating System Structures. Operating System Structures Overview. Operating System Services
TDDI04 Concurrent Programming, Operating Systems, and Real-time Operating Systems Operating System Structures [SGG7] Chapter 2 Copyright Notice: The lecture notes are mainly based on Silberschatz s, Galvin
More informationPROCESS MANAGEMENT. Operating Systems 2015 Spring by Euiseong Seo
PROCESS MANAGEMENT Operating Systems 2015 Spring by Euiseong Seo Today s Topics Process Concept Process Scheduling Operations on Processes Interprocess Communication Examples of IPC Systems Communication
More informationProcess Description and Control. Chapter 3
Process Description and Control 1 Chapter 3 2 Processes Working definition: An instance of a program Processes are among the most important abstractions in an OS all the running software on a computer,
More informationChapter 4: Multithreaded Programming
Chapter 4: Multithreaded Programming Chapter 4: Multithreaded Programming Overview Multicore Programming Multithreading Models Threading Issues Operating System Examples Objectives To introduce the notion
More informationAgenda. Threads. Single and Multi-threaded Processes. What is Thread. CSCI 444/544 Operating Systems Fall 2008
Agenda Threads CSCI 444/544 Operating Systems Fall 2008 Thread concept Thread vs process Thread implementation - user-level - kernel-level - hybrid Inter-process (inter-thread) communication What is Thread
More informationOperating Systems 2 nd semester 2016/2017. Chapter 4: Threads
Operating Systems 2 nd semester 2016/2017 Chapter 4: Threads Mohamed B. Abubaker Palestine Technical College Deir El-Balah Note: Adapted from the resources of textbox Operating System Concepts, 9 th edition
More informationOperating Systems (2INC0) 2018/19. Introduction (01) Dr. Tanir Ozcelebi. Courtesy of Prof. Dr. Johan Lukkien. System Architecture and Networking Group
Operating Systems (2INC0) 20/19 Introduction (01) Dr. Courtesy of Prof. Dr. Johan Lukkien System Architecture and Networking Group Course Overview Introduction to operating systems Processes, threads and
More informationProcesses and Threads. Processes and Threads. Processes (2) Processes (1)
Processes and Threads (Topic 2-1) 2 홍성수 Processes and Threads Question: What is a process and why is it useful? Why? With many things happening at once in a system, need some way of separating them all
More informationChapter 4: Multithreaded Programming
Chapter 4: Multithreaded Programming Chapter 4: Multithreaded Programming Overview Multicore Programming Multithreading Models Threading Issues Operating System Examples Objectives To introduce the notion
More informationKernel Types Simple OS Examples System Calls. Operating Systems. Autumn CS4023
Operating Systems Autumn 2017-2018 Outline 1 2 3 Types of 2.4, SGG The OS Kernel The kernel is the central component of an OS It has complete control over everything that occurs in the system Kernel overview
More information