Shahriar Pirnia Operating system سيستم عامل.

Slides:



Advertisements
Similar presentations
1 Processes and Threads Creation and Termination States Usage Implementations.
Advertisements

1 Processes and Threads Chapter Processes 2.2 Threads 2.3 Interprocess communication 2.4 Classical IPC problems 2.5 Scheduling.
Pertemuan 13 Threads Matakuliah: H0483 / Network Programming Tahun: 2005 Versi: 1.0.
1 Processes (and Threads) (Processes) (Inter-process interactions) (Inter-process communication)  Threads  Thread/IPC Problems+Solutions.
1 Created by Another Process Reason: modeling concurrent sub-tasks Fetch large amount data from network and process them Two sub-tasks: fetching  processing.
Chapter 4: Threads. Overview Multithreading Models Threading Issues Pthreads Windows XP Threads.
Chapter 4: Multithreaded Programming
1 Threads CSCE 351: Operating System Kernels Witawas Srisa-an Chapter 4-5.
Threads Section 2.2. Introduction to threads A thread (of execution) is a light-weight process –Threads reside within processes. –They share one address.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 5: Threads Overview Multithreading Models Threading Issues Pthreads Solaris.
1 Case Study 1: UNIX and LINUX Chapter History of unix 10.2 Overview of unix 10.3 Processes in unix 10.4 Memory management in unix 10.5 Input/output.
Ceng Operating Systems Chapter 2.5 : Threads Process concept  Process scheduling  Interprocess communication  Deadlocks  Threads.
3.5 Interprocess Communication Many operating systems provide mechanisms for interprocess communication (IPC) –Processes must communicate with one another.
3.5 Interprocess Communication
Chapter 2 Processes and Threads Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved
Threads. Processes and Threads  Two characteristics of “processes” as considered so far: Unit of resource allocation Unit of dispatch  Characteristics.
A. Frank - P. Weisberg Operating Systems Introduction to Tasks/Threads.
A. Frank - P. Weisberg Operating Systems Threads Implementation.
Threads Chapter 4. Modern Process & Thread –Process is an infrastructure in which execution takes place  (address space + resources) –Thread is a program.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 4: Multithreaded Programming.
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.
1 Processes and Threads Chapter Processes 2.2 Threads 2.3 Interprocess communication 2.4 Classical IPC problems 2.5 Scheduling.
Processes and Threads.
1 Process States (1) Possible process states –running –blocked –ready Transitions between states shown.
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.
Threads, Thread management & Resource Management.
10/16/ Realizing Concurrency using the thread model B. Ramamurthy.
MODERN OPERATING SYSTEMS Third Edition ANDREW S. TANENBAUM Chapter 2 Processes and Threads Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall,
1 Processes, Threads, Race Conditions & Deadlocks Operating Systems Review.
 2004 Deitel & Associates, Inc. All rights reserved. 1 Chapter 4 – Thread Concepts Outline 4.1 Introduction 4.2Definition of Thread 4.3Motivation for.
B. RAMAMURTHY 10/24/ Realizing Concurrency using the thread model.
1 Lecture 4: Threads Advanced Operating System Fall 2010.
Chapter 4: Threads. 2 Overview Multithreading Models Threading Issues Pthreads Windows XP Threads Linux Threads.
Joonwon Lee Process and Address Space.
Lecture 5: Threads process as a unit of scheduling and a unit of resource allocation processes vs. threads what to program with threads why use threads.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 4: Threads.
1 Chapter 2.5 : Threads Process concept  Process concept  Process scheduling  Process scheduling  Interprocess communication  Interprocess communication.
Cs431-cotter1 Processes and Threads Tanenbaum 2.1, 2.2 Crowley Chapters 3, 5 Stallings Chapter 3, 4 Silberschaz & Galvin 3, 4.
Processes and Threads MICROSOFT.  Process  Process Model  Process Creation  Process Termination  Process States  Implementation of Processes  Thread.
ITEC 502 컴퓨터 시스템 및 실습 Chapter 2-2: Threads Mi-Jung Choi DPNM Lab. Dept. of CSE, POSTECH.
操作系统原理 OPERATING SYSTEM Chapter 2 Processes and Threads 进程与线程.
B. RAMAMURTHY 5/10/2013 Amrita-UB-MSES Realizing Concurrency using the thread model.
7/9/ Realizing Concurrency using Posix Threads (pthreads) B. Ramamurthy.
1 Chapter 5: Threads Overview Multithreading Models & Issues Read Chapter 5 pages
Lecture 5. Example for periority The average waiting time : = 41/5= 8.2.
Realizing Concurrency using the thread model
Case Study 1: UNIX and LINUX
Realizing Concurrency using the thread model
Thread Programming.
Chapter 2 Processes and Threads Today 2.1 Processes 2.2 Threads
MODERN OPERATING SYSTEMS Third Edition ANDREW S
Realizing Concurrency using Posix Threads (pthreads)
Realizing Concurrency using the thread model
Lecture 10: Threads Implementation
Implementing Threads in User Space
Realizing Concurrency using the thread model
Chapter 2 Processes and Threads 2.1 Processes 2.2 Threads
Prof. Leonardo Mostarda University of Camerino
Operating Systems Threads 1.
Realizing Concurrency using the thread model
Realizing Concurrency using Posix Threads (pthreads)
Realizing Concurrency using the thread model
Lecture 10: Threads Implementation
Realizing Concurrency using Posix Threads (pthreads)
Thread Model for Work Unit
What is a Thread? A thread is similar to a process, but it typically consists of just the flow of control. Multiple threads use the address space of a.
Threads CSE 2431: Introduction to Operating Systems
CS Introduction to Operating Systems
Presentation transcript:

Shahriar Pirnia Operating system سيستم عامل

Threads The Thread Model (1) (a) Three processes each with one thread (b) One process with three threads

The Thread Model (2) Items shared by all threads in a process Items private to each thread

The Thread Model (3) Each thread has its own stack

Thread Usage (1) A word processor with three threads

Thread Usage (2) A multithreaded Web server

Thread Usage (3) Rough outline of code for previous slide (a) Dispatcher thread (b) Worker thread

Thread Usage (4) Three ways to construct a server

Implementing Threads in User Space A user-level threads package

Implementing Threads in the Kernel A threads package managed by the kernel

Hybrid Implementations Multiplexing user-level threads onto kernel- level threads

Scheduler Activations Goal – mimic functionality of kernel threads –gain performance of user space threads Avoids unnecessary user/kernel transitions Kernel assigns virtual processors to each process –lets runtime system allocate threads to processors Problem: Fundamental reliance on kernel (lower layer) calling procedures in user space (higher layer)

Pop-Up Threads Creation of a new thread when message arrives (a) before message arrives (b) after message arrives

Making Single-Threaded Code Multithreaded (1) Conflicts between threads over the use of a global variable

Making Single-Threaded Code Multithreaded (2) Threads can have private global variables

Threads in POSIX The principal POSIX thread calls.

The ls Command Steps in executing the command ls type to the shell

Flags for Linux clone Bits in the sharing_flags bitmap