Inter-task communication mechanisms
|
|
- Elisabeth Casey
- 6 years ago
- Views:
Transcription
1 Inter-task communication mechanisms Sistemi Real-Time Prof. Davide Brugali Università degli Studi di Bergamo Tratto da G.C. Buttazzo, «Sistemi in Tempo Reale», Capitolo 10
2 Global shared variables In most RT applications, tasks exchange data through global shared variables. Advantages this is the fastest mechanism low run-time overhead schedulability analysis is available Disadvantages Data must be accessed in mutual exclusion: non-preemptive regions; semaphores, priority inheritance, priority ceiling. Not good for modular design: local details are exposed to other tasks; a change in a task affect other tasks. 2
3 Message passing paradigm Another approach is to exchange data through a message passing paradigm: Every task operates on a private memory space; Data are exchanged by messages through a channel. 3
4 Communication Ports Many operating systems provides the channel abstraction through the port construct. A task can use a port to exchange messages by means of two primitives: send sends a message to a port receive receives a message from a port Some operating systems allows the user to define different types of ports, with peculiar semantics 4
5 Port characteristics Ports may differ for: number of tasks allowed to send messages; number of tasks allowed to receive messages; policy used to insert and extract messages. behavior to manage exceptions (sending to a full port or receiving from an empty port). Before being used, a port has to be created, and then destroyed when it is not needed any more. Port attributes need to be defined at creation time 5
6 Sending a message 6
7 Receiving a message 7
8 Using a port 8
9 Periodic task communication 9
10 Periodic task communication 10
11 Periodic task communication 11
12 Exchanged messages 12
13 Buffer saturation 13
14 STICK Ports 14
15 STICK Ports 15
16 Blocking on STICK ports Although a task cannot blocks for a full or empty buffer, it can block for mutual exclusion: indeed a semaphore is needed to protect the internal buffer from simultaneous accesses. Long messages may cause long blocking delays on such a semaphore. Long waiting times due to long messages can be avoided through a buffer replication mechanism. 16
17 Cyclic Asynchronous Buffer (CAB) It is a mechanism for exchanging messages among periodic tasks with different rates. Memory conflicts are avoided by replicating the internal buffers. At any time, the most recent message is always available for reading. A new message overrides the previous one. Messages are not consumed by reading. 17
18 Simultaneous accesses 18
19 Dual buffering Dual buffering is often used to transfer large data, (images) from the input peripheral device to a task: Once written, the new message becomes available to the next reader: 19
20 Accessing a CAB A CAB generalizes dual buffering for N readers; Data is accessed through a memory pointer. Hence, a reader is not forced to copy the message in its memory space. More tasks can concurrently read the same message. At any time, a pointer (mrb) points to the most recent buffer used for writing a new message. 20
21 CAB example 21
22 CAB example 22
23 CAB example 23
24 Dimensioning a CAB If a CAB is used by N tasks, to avoid blocking, it must have at least N +1 buffers. The (N+1)-th buffer is needed for keeping the most recent message in the case all the other buffers are used. 24
25 Inconsistency with N buffers 25
26 Writing Protocol To write a message in a CAB a task must: 1. ask the CAB for a pointer to a free buffer; 2. copy the message into the buffer using the pointer; 3. release the pointer to the CAB to make the message accessible to the next reader. 26
27 Reading Protocol To read a message from a CAB a task must 1. get the pointer to the most recent message in the CAB; 2. process the message through the pointer; 3. release the pointer, to allow the CAB to recycle the buffer if it is not used. 27
28 CAB Primitives 28
29 CAB Primitives 29
30 Writing in a CAB 30
31 Reading from a CAB 31
32 Implementing CABs 32
33 cab_reserve() 33
34 cab_putmes() 34
35 cab_getmes() 35
36 cab_unget() 36
37 Scheduling Policy in Posix 37
38 Scheduling policy 38
39 Scheduling in POSIX 39
40 Example pthread_t th1, th2, th3; pthread_attr_t my_attr; struct sched_param param1, param2, param3; pthread_attr_init(&my_attr); pthread_attr_setschedpolicy(&my_attr, SCHED_FIFO); param1.sched_priority = 1; pthread_attr_setschedparam(&my_attr, ¶m1); pthread_create(&th1, & my_attr, task1, 0); param2.sched_priority = 2; pthread_attr_setschedparam(& my_attr, ¶m2); pthread_create(&th2, & my_attr, task2, 0); param3.sched_priority = 3; pthread_attr_setschedparam(& my_attr, ¶m3); pthread_create(&th3, & my_attr, task3, 0); pthread_attr_destroy(& my_attr); 40
41 Setting protocol attributes 41
42 Priority Ceiling 42
43 Example with priority inheritance 43
44 Example with priority ceiling 44
Global shared variables. Message passing paradigm. Communication Ports. Port characteristics. Sending a message 07/11/2018
Global shared variables In most RT applications, tasks exchange data through global shared variables. Advantages High efficiency Low run-time overhead Schedulability analysis is available Disadvantages
More informationreal time operating systems course
real time operating systems course 4 introduction to POSIX pthread programming introduction thread creation, join, end thread scheduling thread cancellation semaphores thread mutexes and condition variables
More informationProgramming RT systems with pthreads
Programming RT systems with pthreads Giuseppe Lipari http://feanor.sssup.it/~lipari Scuola Superiore Sant Anna Pisa December 1, 2011 Outline 1 Timing utilities 2 Periodic threads 3 Scheduler selection
More informationProgramming RT systems with pthreads
Programming RT systems with pthreads Giuseppe Lipari http://www.lifl.fr/~lipari CRIStAL - University de Lille 1 October 4, 2015 G. Lipari (CRIStAL) Programming RT systems with pthreads October 4, 2015
More informationEmbedded Systems. 6. Real-Time Operating Systems
Embedded Systems 6. Real-Time Operating Systems Lothar Thiele 6-1 Contents of Course 1. Embedded Systems Introduction 2. Software Introduction 7. System Components 10. Models 3. Real-Time Models 4. Periodic/Aperiodic
More informationExperience with Processes and Monitors in Mesa. Arvind Krishnamurthy
Experience with Processes and Monitors in Mesa Arvind Krishnamurthy Background Focus of this paper: light-weight processes (threads) and how they synchronize with each other History: Second system; followed
More informationPOSIX Threads. Paolo Burgio
POSIX Threads Paolo Burgio paolo.burgio@unimore.it The POSIX IEEE standard Specifies an operating system interface similar to most UNIX systems It extends the C language with primitives that allows the
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 informationOperating system concepts. Task scheduling
Operating system concepts Task scheduling Task scheduling (thread scheduling) Target of scheduling are ready tasks ACTIVE TASK BLOCKED TASKS PASSIVE TASKS READY TASKS Active task currently running on processor
More informationThreads. Threads (continued)
Threads A thread is an alternative model of program execution A process creates a thread through a system call Thread operates within process context Use of threads effectively splits the process state
More informationDeadlock. Concurrency: Deadlock and Starvation. Reusable Resources
Concurrency: Deadlock and Starvation Chapter 6 Deadlock Permanent blocking of a set of processes that either compete for system resources or communicate with each other No efficient solution Involve conflicting
More informationUser Space Multithreading. Computer Science, University of Warwick
User Space Multithreading 1 Threads Thread short for thread of execution/control B efore create Global During create Global Data Data Executing Code Code Stack Stack Stack A fter create Global Data Executing
More informationReal-Time Systems and Programming Languages
Degree Examinations 1999 DEPARTMENT OF COMPUTER SCIENCE Real-Time Systems and Programming Languages Time allowed: Three (3) hours Candidates should answer not more than four questions 1 (25 marks) (i)
More informationProcess Concept. Minsoo Ryu. Real-Time Computing and Communications Lab. Hanyang University.
Process Concept Minsoo Ryu Real-Time Computing and Communications Lab. Hanyang University msryu@hanyang.ac.kr Topics Covered Process Concept Definition, states, PCB Process Scheduling Scheduling queues,
More informationHigh Performance Computing Lecture 21. Matthew Jacob Indian Institute of Science
High Performance Computing Lecture 21 Matthew Jacob Indian Institute of Science Semaphore Examples Semaphores can do more than mutex locks Example: Consider our concurrent program where process P1 reads
More informationThe Real-time Specification for Java
The Real-time Specification for Java Roadmap Overview of the RTSJ Memory Management Clocks and Time Scheduling and Schedulable Objects Asynchronous Events and Handlers Real-Time Threads Asynchronous Transfer
More informationOperating systems and concurrency (B10)
Operating systems and concurrency (B10) David Kendall Northumbria University David Kendall (Northumbria University) Operating systems and concurrency (B10) 1 / 26 Introduction This lecture looks at Some
More informationCSE 451: Operating Systems Winter Lecture 7 Synchronization. Steve Gribble. Synchronization. Threads cooperate in multithreaded programs
CSE 451: Operating Systems Winter 2005 Lecture 7 Synchronization Steve Gribble Synchronization Threads cooperate in multithreaded programs to share resources, access shared data structures e.g., threads
More informationCS 3305 Intro to Threads. Lecture 6
CS 3305 Intro to Threads Lecture 6 Introduction Multiple applications run concurrently! This means that there are multiple processes running on a computer Introduction Applications often need to perform
More informationCommercial Real-time Operating Systems An Introduction. Swaminathan Sivasubramanian Dependable Computing & Networking Laboratory
Commercial Real-time Operating Systems An Introduction Swaminathan Sivasubramanian Dependable Computing & Networking Laboratory swamis@iastate.edu Outline Introduction RTOS Issues and functionalities LynxOS
More informationAC59/AT59/AC110/AT110 OPERATING SYSTEMS & SYSTEMS SOFTWARE DEC 2015
Q.2 a. Explain the following systems: (9) i. Batch processing systems ii. Time sharing systems iii. Real-time operating systems b. Draw the process state diagram. (3) c. What resources are used when a
More informationConcurrent Server Design Multiple- vs. Single-Thread
Concurrent Server Design Multiple- vs. Single-Thread Chuan-Ming Liu Computer Science and Information Engineering National Taipei University of Technology Fall 2007, TAIWAN NTUT, TAIWAN 1 Examples Using
More informationHigh Performance Computing Course Notes Shared Memory Parallel Programming
High Performance Computing Course Notes 2009-2010 2010 Shared Memory Parallel Programming Techniques Multiprocessing User space multithreading Operating system-supported (or kernel) multithreading Distributed
More informationOperating Systems. Thread Synchronization Primitives. Thomas Ropars.
1 Operating Systems Thread Synchronization Primitives Thomas Ropars thomas.ropars@univ-grenoble-alpes.fr 2017 2 Agenda Week 42/43: Synchronization primitives Week 44: Vacation Week 45: Synchronization
More informationCYES-C++: A Concurrent Extension of C++ through Compositional Mechanisms
CYES-C++: A Concurrent Extension of C++ through Compositional Mechanisms Raju Pandey J. C. Browne Department of Computer Sciences The University of Texas at Austin Austin, TX 78712 fraju, browneg@cs.utexas.edu
More informationEPL372 Lab Exercise 2: Threads and pthreads. Εργαστήριο 2. Πέτρος Παναγή
EPL372 Lab Exercise 2: Threads and pthreads Εργαστήριο 2 Πέτρος Παναγή 1 Threads Vs Processes 2 Process A process is created by the operating system, and requires a fair amount of "overhead". Processes
More informationOutline. CS4254 Computer Network Architecture and Programming. Introduction 2/4. Introduction 1/4. Dr. Ayman A. Abdel-Hamid.
Threads Dr. Ayman Abdel-Hamid, CS4254 Spring 2006 1 CS4254 Computer Network Architecture and Programming Dr. Ayman A. Abdel-Hamid Computer Science Department Virginia Tech Threads Outline Threads (Chapter
More informationReal-Time Systems Hermann Härtig Real-Time Operating Systems Brief Overview
Real-Time Systems Hermann Härtig Real-Time Operating Systems Brief Overview 02/02/12 Outline Introduction Basic variants of RTOSes Real-Time paradigms Common requirements for all RTOSes High level resources
More informationReal-Time Systems. Real-Time Operating Systems
Real-Time Systems Real-Time Operating Systems Hermann Härtig WS 2018/19 Outline Introduction Basic variants of RTOSes Real-Time paradigms Common requirements for all RTOSes High level resources Non-Real-Time
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 informationCS533 Concepts of Operating Systems. Jonathan Walpole
CS533 Concepts of Operating Systems Jonathan Walpole Introduction to Threads and Concurrency Why is Concurrency Important? Why study threads and concurrent programming in an OS class? What is a thread?
More informationConcurrency, Thread. Dongkun Shin, SKKU
Concurrency, Thread 1 Thread Classic view a single point of execution within a program a single PC where instructions are being fetched from and executed), Multi-threaded program Has more than one point
More informationWhat s An OS? Cyclic Executive. Interrupts. Advantages Simple implementation Low overhead Very predictable
What s An OS? Provides environment for executing programs Process abstraction for multitasking/concurrency scheduling Hardware abstraction layer (device drivers) File systems Communication Do we need an
More informationCSE 451: Operating Systems Winter Lecture 7 Synchronization. Hank Levy 412 Sieg Hall
CSE 451: Operating Systems Winter 2003 Lecture 7 Synchronization Hank Levy Levy@cs.washington.edu 412 Sieg Hall Synchronization Threads cooperate in multithreaded programs to share resources, access shared
More informationSubject: Operating System (BTCOC403) Class: S.Y.B.Tech. (Computer Engineering)
A. Multiple Choice Questions (60 questions) Subject: Operating System (BTCOC403) Class: S.Y.B.Tech. (Computer Engineering) Unit-I 1. What is operating system? a) collection of programs that manages hardware
More informationThreading and Synchronization. Fahd Albinali
Threading and Synchronization Fahd Albinali Parallelism Parallelism and Pseudoparallelism Why parallelize? Finding parallelism Advantages: better load balancing, better scalability Disadvantages: process/thread
More informationInterprocess Communication By: Kaushik Vaghani
Interprocess Communication By: Kaushik Vaghani Background Race Condition: A situation where several processes access and manipulate the same data concurrently and the outcome of execution depends on the
More informationCS 333 Introduction to Operating Systems. Class 3 Threads & Concurrency. Jonathan Walpole Computer Science Portland State University
CS 333 Introduction to Operating Systems Class 3 Threads & Concurrency Jonathan Walpole Computer Science Portland State University 1 Process creation in UNIX All processes have a unique process id getpid(),
More informationR13 SET - 1 2. Answering the question in Part-A is compulsory 1 a) Define Operating System. List out the objectives of an operating system. [3M] b) Describe different attributes of the process. [4M] c)
More informationConcurrent Control with "Readers" and "Writers"
Concurrent Control with "Readers" and "Writers" P. J. Courtois, F. Heymans and D. L. Parnas Communication of the ACM, 14, 10 (Oct. 1971) Presenters: Prashant Agrawal Vineet Bansal Main Paper Critical section
More informationReal-Time Systems and Programming Languages
Real-Time Systems and Programming Languages Ada, Real-Time Java and C/Real-Time POSIX Fourth Edition Alan Burns and Andy Wellings University of York * ADDISON-WESLEY An imprint of Pearson Education Harlow,
More informationXenomai Real-Time nanokernel
Xenomai Real-Time nanokernel Ricardo Correia Pinto ricardo.pinto@ciencias.ulisboa.pt Faculty of Sciences - University of Lisboa Sistemas Embebidos e de Tempo-Real 2014/2015 Xenomai Real-Time nanokernel
More informationCHAPTER 6: PROCESS SYNCHRONIZATION
CHAPTER 6: PROCESS SYNCHRONIZATION 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. TOPICS Background
More informationOperating Systems: William Stallings. Starvation. Patricia Roy Manatee Community College, Venice, FL 2008, Prentice Hall
Operating Systems: Internals and Design Principles, 6/E William Stallings Chapter 6 Concurrency: Deadlock and Starvation Patricia Roy Manatee Community College, Venice, FL 2008, Prentice Hall Deadlock
More informationExercise (could be a quiz) Solution. Concurrent Programming. Roadmap. Tevfik Koşar. CSE 421/521 - Operating Systems Fall Lecture - IV Threads
Exercise (could be a quiz) 1 2 Solution CSE 421/521 - Operating Systems Fall 2013 Lecture - IV Threads Tevfik Koşar 3 University at Buffalo September 12 th, 2013 4 Roadmap Threads Why do we need them?
More informationChapter 2 Processes and Threads
MODERN OPERATING SYSTEMS Third Edition ANDREW S. TANENBAUM Chapter 2 Processes and Threads The Process Model Figure 2-1. (a) Multiprogramming of four programs. (b) Conceptual model of four independent,
More informationMultitasking / Multithreading system Supports multiple tasks
Tasks and Intertask Communication Introduction Multitasking / Multithreading system Supports multiple tasks As we ve noted Important job in multitasking system Exchanging data between tasks Synchronizing
More informationModule 1. Introduction:
Module 1 Introduction: Operating system is the most fundamental of all the system programs. It is a layer of software on top of the hardware which constitutes the system and manages all parts of the system.
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 informationResource management. Real-Time Systems. Resource management. Resource management
Real-Time Systems Specification Implementation Verification Mutual exclusion is a general problem that exists at several levels in a real-time system. Shared resources internal to the the run-time system:
More informationConcurrency: Deadlock and Starvation. Chapter 6
Concurrency: Deadlock and Starvation Chapter 6 Deadlock Permanent blocking of a set of processes that either compete for system resources or communicate with each other Involve conflicting needs for resources
More informationIntroduction to PThreads and Basic Synchronization
Introduction to PThreads and Basic Synchronization Michael Jantz, Dr. Prasad Kulkarni Dr. Douglas Niehaus EECS 678 Pthreads Introduction Lab 1 Introduction In this lab, we will learn about some basic synchronization
More informationSistemi in tempo reale Anno accademico
Sistemi in tempo reale Anno accademico 2006-2007 Concorrenza - II Giuseppe Lipari http://feanor.sssup.it/~lipari Scuola Superiore Sant Anna Outline 1 Introduction to concurrency 2 Models of concurrency:
More informationImplementing Task Schedulers (1) Real-Time and Embedded Systems (M) Lecture 10
Implementing Task Schedulers (1) Real-Time and Embedded Systems (M) Lecture 10 Lecture Outline Implementing priority scheduling: Tasks, threads and queues Building a priority scheduler Fixed priority scheduling
More informationReal Time Operating System: Inter-Process Communication (IPC)
ECE3411 Fall 2015 Lecture 6c. Real Time Operating System: Inter-Process Communication (IPC) Marten van Dijk, Syed Kamran Haider Department of Electrical & Computer Engineering University of Connecticut
More informationLINUX INTERNALS & NETWORKING Weekend Workshop
Here to take you beyond LINUX INTERNALS & NETWORKING Weekend Workshop Linux Internals & Networking Weekend workshop Objectives: To get you started with writing system programs in Linux Build deeper view
More information11/04/2018. Outline. Process. Process. Pthread Library. Process and threads
Outline 1. General descriptions 2. Thread management 3. Scheduler(s) in Linux 4. Time management 5. Handling periodic threads 6. Mutual exclusion 7. Examples Process A process is the main execution entity
More informationEmbedded Systems. 5. Operating Systems. Lothar Thiele. Computer Engineering and Networks Laboratory
Embedded Systems 5. Operating Systems Lothar Thiele Computer Engineering and Networks Laboratory Embedded Operating Systems 5 2 Embedded Operating System (OS) Why an operating system (OS) at all? Same
More informationSemaphore. Originally called P() and V() wait (S) { while S <= 0 ; // no-op S--; } signal (S) { S++; }
Semaphore Semaphore S integer variable Two standard operations modify S: wait() and signal() Originally called P() and V() Can only be accessed via two indivisible (atomic) operations wait (S) { while
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 informationSynchronization I. Jo, Heeseung
Synchronization I Jo, Heeseung Today's Topics Synchronization problem Locks 2 Synchronization Threads cooperate in multithreaded programs To share resources, access shared data structures Also, to coordinate
More informationOPERATING SYSTEMS. UNIT II Sections A, B & D. An operating system executes a variety of programs:
OPERATING SYSTEMS UNIT II Sections A, B & D PREPARED BY ANIL KUMAR PRATHIPATI, ASST. PROF., DEPARTMENT OF CSE. PROCESS CONCEPT An operating system executes a variety of programs: Batch system jobs Time-shared
More informationReal-Time Systems Resource Access Protocols
Real-Time Systems Resource Access Protocols WS 2016/17 Problems: Priority Inversion Assumptions: Jobs use resources in a mutually exclusive manner Preemptive priority-driven scheduling Fixed task priorities
More informationWEEK 5 - APPLICATION OF PETRI NETS. 4.4 Producers-consumers problem with priority
4.4 Producers-consumers problem with priority The net shown in Fig. 27 represents a producers-consumers system with priority, i.e., consumer A has priority over consumer B in the sense that A can consume
More informationIntroduction History RTCore PREEMPT RT Demo Usage References. Real-Time Linux. Christopher Schuster
Real-Time Linux Christopher Schuster Project Seminar: Distributed Real-time Systems (summer term 2010) Prof. Dr. Andreas Polze, Jan-Arne Sobania, M.Sc., Uwe Hentschel, M.Sc. Hasso-Plattner-Institut, Universität
More informationPerformance Throughput Utilization of system resources
Concurrency 1. Why concurrent programming?... 2 2. Evolution... 2 3. Definitions... 3 4. Concurrent languages... 5 5. Problems with concurrency... 6 6. Process Interactions... 7 7. Low-level Concurrency
More informationCS420: Operating Systems. Interprocess Communication
Interprocess Communication James Moscola Department of Physical Sciences York College of Pennsylvania Based on Operating System Concepts, 9th Edition by Silberschatz, Galvin, Gagne Interprocess Communication
More informationChapter 5 Concurrency: Mutual Exclusion and Synchronization
Operating Systems: Internals and Design Principles Chapter 5 Concurrency: Mutual Exclusion and Synchronization Seventh Edition By William Stallings Designing correct routines for controlling concurrent
More informationIn the example, since printf() was never declared, the compiler had to try to figure out what kind of function it is.
Ans 1.a Dynamic lookup means that when a message is sent to an object, the method to be executed is selected dynamically, at run time, according to the implementation of the object that receives the message.
More informationReal-Time Programming
Real-Time Programming Week 7: Real-Time Operating Systems Instructors Tony Montiel & Ken Arnold rtp@hte.com 4/1/2003 Co Montiel 1 Objectives o Introduction to RTOS o Event Driven Systems o Synchronization
More informationCOP 4225 Advanced Unix Programming. Synchronization. Chi Zhang
COP 4225 Advanced Unix Programming Synchronization Chi Zhang czhang@cs.fiu.edu 1 Cooperating Processes Independent process cannot affect or be affected by the execution of another process. Cooperating
More informationLab-exercise. Industrialization & Training in Microelectronics. Cluster: Cluster9 Module: Module1 Threads. Target group: Teacher and student
O The Microelectronics Training Center The MTC is an initiative within the INVOMEC division Industrialization & Training in Microelectronics Introduction This lab is the first of a series explaining the
More information2 Threads vs. Processes
9 2 Threads vs. Processes A process includes an address space (defining all the code and data pages) a resource container (OS resource and accounting information) a thread of control, which defines where
More informationOPERATING SYSTEM CONCEPTS UNDERSTAND!!! IMPLEMENT!!! ANALYZE!!!
OPERATING SYSTEM CONCEPTS UNDERSTAND!!! IMPLEMENT!!! Processor Management Memory Management IO Management File Management Multiprogramming Protection and Security Network Management UNDERSTAND!!! IMPLEMENT!!!
More informationThreads. Threads The Thread Model (1) CSCE 351: Operating System Kernels Witawas Srisa-an Chapter 4-5
Threads CSCE 351: Operating System Kernels Witawas Srisa-an Chapter 4-5 1 Threads The Thread Model (1) (a) Three processes each with one thread (b) One process with three threads 2 1 The Thread Model (2)
More informationReal-Time Operating Systems Design and Implementation. LS 12, TU Dortmund
Real-Time Operating Systems Design and Implementation (slides are based on Prof. Dr. Jian-Jia Chen) Anas Toma, Jian-Jia Chen LS 12, TU Dortmund October 19, 2017 Anas Toma, Jian-Jia Chen (LS 12, TU Dortmund)
More informationReal-Time Systems. Lecture #4. Professor Jan Jonsson. Department of Computer Science and Engineering Chalmers University of Technology
Real-Time Systems Lecture #4 Professor Jan Jonsson Department of Computer Science and Engineering Chalmers University of Technology Real-Time Systems Specification Resource management Mutual exclusion
More informationCOP 5611 Operating Systems Spring Dan C. Marinescu Office: HEC 439 B Office hours: M-Wd 2:00-3:00 PM
COP 5611 Operating Systems Spring 2010 Dan C. Marinescu Office: HEC 439 B Office hours: M-Wd 2:00-3:00 PM Lecture 6 Last time: Virtualization Today: Thread coordination Scheduling Next Time: Multi-level
More informationProcess Co-ordination OPERATING SYSTEMS
OPERATING SYSTEMS Prescribed Text Book Operating System Principles, Seventh Edition By Abraham Silberschatz, Peter Baer Galvin and Greg Gagne 1 PROCESS - CONCEPT Processes executing concurrently in the
More informationConcurrent & Distributed Systems Supervision Exercises
Concurrent & Distributed Systems Supervision Exercises Stephen Kell Stephen.Kell@cl.cam.ac.uk November 9, 2009 These exercises are intended to cover all the main points of understanding in the lecture
More informationOperating Systems Comprehensive Exam. Spring Student ID # 3/16/2006
Operating Systems Comprehensive Exam Spring 2006 Student ID # 3/16/2006 You must complete all of part I (60%) You must complete two of the three sections in part II (20% each) In Part I, circle or select
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 informationOperating Systems. Lecture 4 - Concurrency and Synchronization. Master of Computer Science PUF - Hồ Chí Minh 2016/2017
Operating Systems Lecture 4 - Concurrency and Synchronization Adrien Krähenbühl Master of Computer Science PUF - Hồ Chí Minh 2016/2017 Mutual exclusion Hardware solutions Semaphores IPC: Message passing
More informationCPSC 313: Intro to Computer Systems. POSIX Threads. Latency Hiding / Multiprogramming (covered earlier) Ease of Programming (covered now)
Why Threads? Latency Hiding / Multiprogramming (covered earlier) Ease of Programming (covered now) (R&R, Chapter 12) Thread Management Thread Safety Thread Attributes Why Threads? Latency Hiding / Multiprogramming
More informationCS/ECE 6780/5780. Al Davis
CS/ECE 6780/5780 Al Davis Today s topics: Threads basic control block scheduling semaphores Midterm (next Tues) covers Chaps & Labs 1-5 sample on the web 1 CS 5780 Lab 5 Logistics Problem not enough interrupt
More informationPage 1. Lab 5 Logistics. Implicit Threads. Explicit Thread Semantics. Problem not enough interrupt pins CS/ECE 6780/5780. Al Davis
Lab 5 Logistics CS/ECE 6780/5780 Al Davis Today s topics: Threads basic control block scheduling semaphores Midterm (next Tues) covers Chaps & Labs 1-5 sample on the web Problem not enough interrupt pins
More informationReal Time Operating Systems and Middleware
Real Time Operating Systems and Middleware POSIX Threads Synchronization Luca Abeni abeni@dit.unitn.it Real Time Operating Systems and Middleware p. 1 Threads Synchronisation All the threads running in
More informationCS 333 Introduction to Operating Systems. Class 3 Threads & Concurrency. Jonathan Walpole Computer Science Portland State University
CS 333 Introduction to Operating Systems Class 3 Threads & Concurrency Jonathan Walpole Computer Science Portland State University 1 The Process Concept 2 The Process Concept Process a program in execution
More informationThread. Disclaimer: some slides are adopted from the book authors slides with permission 1
Thread Disclaimer: some slides are adopted from the book authors slides with permission 1 IPC Shared memory Recap share a memory region between processes read or write to the shared memory region fast
More informationVALLIAMMAI ENGINEERING COLLEGE
VALLIAMMAI ENGINEERING COLLEGE SRM Nagar, Kattankulathur 603 203 DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING QUESTION BANK II SEMESTER CP7204 Advanced Operating Systems Regulation 2013 Academic Year
More informationCS 261 Fall Mike Lam, Professor. Threads
CS 261 Fall 2017 Mike Lam, Professor Threads Parallel computing Goal: concurrent or parallel computing Take advantage of multiple hardware units to solve multiple problems simultaneously Motivations: Maintain
More informationReal-time Support in Operating Systems
Real-time Support in Operating Systems Colin Perkins teaching/2003-2004/rtes4/lecture11.pdf Lecture Outline Overview of the rest of the module Real-time support in operating systems Overview of concepts
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 informationCS A331 Programming Language Concepts
CS A331 Programming Language Concepts Lecture 12 Alternative Language Examples (General Concurrency Issues and Concepts) March 30, 2014 Sam Siewert Major Concepts Concurrent Processing Processes, Tasks,
More informationGreen Hills Software, Inc.
Green Hills Software, Inc. A Safe Tasking Approach to Ada95 Jim Gleason Engineering Manager Ada Products 5.0-1 Overview Multiple approaches to safe tasking with Ada95 No Tasking - SPARK Ada95 Restricted
More informationAI Non-Preemptive Dispatching. A new dispatching policy is defined for the non-preemptive execution of Ada tasks.
AI-00298 Non-Preemptive Dispatching!standard D.2.4 (00) 04-05-24 AI95-00298/05!reference AI95-00321!class amendment 02-06-01!status Amendment 200Y 03-07-02!status WG9 Approved 04-06-18!status ARG Approved
More informationOperating Systems. Designed and Presented by Dr. Ayman Elshenawy Elsefy
Operating Systems Designed and Presented by Dr. Ayman Elshenawy Elsefy Dept. of Systems & Computer Eng.. AL-AZHAR University Website : eaymanelshenawy.wordpress.com Email : eaymanelshenawy@yahoo.com Reference
More informationProcess Synchronization: Semaphores. CSSE 332 Operating Systems Rose-Hulman Institute of Technology
Process Synchronization: Semaphores CSSE 332 Operating Systems Rose-Hulman Institute of Technology Critical-section problem solution 1. Mutual Exclusion - If process Pi is executing in its critical section,
More informationCS604 - Operating System Solved Subjective Midterm Papers For Midterm Exam Preparation
CS604 - Operating System Solved Subjective Midterm Papers For Midterm Exam Preparation The given code is as following; boolean flag[2]; int turn; do { flag[i]=true; turn=j; while(flag[j] && turn==j); critical
More informationConcurrency: Deadlock and Starvation
Concurrency: Deadlock and Starvation Chapter 6 E&CE 354: Processes 1 Deadlock Deadlock = situation in which every process from a set is permanently blocked, i.e. cannot proceed with execution Common cause:
More information