Tasks and Task Management : --Time-critical tasks --Contending tasks --Communicating tasks.

Slides:



Advertisements
Similar presentations
Operating Systems Part III: Process Management (Process Synchronization)
Advertisements

Ch. 7 Process Synchronization (1/2) I Background F Producer - Consumer process :  Compiler, Assembler, Loader, · · · · · · F Bounded buffer.
5.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts with Java – 8 th Edition Chapter 5: CPU Scheduling.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 6: Process Synchronization.
Concurrency: mutual exclusion and synchronization Slides are mainly taken from «Operating Systems: Internals and Design Principles”, 8/E William Stallings.
CY2003 Computer Systems Lecture 05 Semaphores - Theory.
Operating Systems CMPSC 473 Mutual Exclusion Lecture 13: October 12, 2010 Instructor: Bhuvan Urgaonkar.
6.5 Semaphore Can only be accessed via two indivisible (atomic) operations wait (S) { while S
Chapter 5 Concurrency: Mutual Exclusion and Synchronization Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee.
Avishai Wool lecture Introduction to Systems Programming Lecture 4 Inter-Process / Inter-Thread Communication.
5.6 Semaphores Semaphores –Software construct that can be used to enforce mutual exclusion –Contains a protected variable Can be accessed only via wait.
Chapter 6: Process Synchronization. 6.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Feb 8, 2005 Objectives Understand.
5.6.2 Thread Synchronization with Semaphores Semaphores can be used to notify other threads that events have occurred –Producer-consumer relationship Producer.
University of Pennsylvania 9/19/00CSE 3801 Concurrent Processes CSE 380 Lecture Note 4 Insup Lee.
Chapter 2.3 : Interprocess Communication
IPC and Classical Synchronization Problems
Real-Time Kernels and Operating Systems. Operating System: Software that coordinates multiple tasks in processor, including peripheral interfacing Types.
1 Concurrency: Deadlock and Starvation Chapter 6.
Race Conditions CS550 Operating Systems. Review So far, we have discussed Processes and Threads and talked about multithreading and MPI processes by example.
Operating Systems CSE 411 CPU Management Oct Lecture 13 Instructor: Bhuvan Urgaonkar.
General What is an OS? What do you get when you buy an OS? What does the OS do? What are the parts of an OS? What is the kernel? What is a device.
Semaphores and Bounded Buffer Andy Wang Operating Systems COP 4610 / CGS 5765.
Threads in Java. History  Process is a program in execution  Has stack/heap memory  Has a program counter  Multiuser operating systems since the sixties.
Concurrency: Mutual Exclusion and Synchronization Chapter 5.
6.3 Peterson’s Solution The two processes share two variables: Int turn; Boolean flag[2] The variable turn indicates whose turn it is to enter the critical.
Operating Systems CMPSC 473 Mutual Exclusion Lecture 14: October 14, 2010 Instructor: Bhuvan Urgaonkar.
Midterm 1 – Wednesday, June 4  Chapters 1-3: understand material as it relates to concepts covered  Chapter 4 - Processes: 4.1 Process Concept 4.2 Process.
1 Announcements The fixing the bug part of Lab 4’s assignment 2 is now considered extra credit. Comments for the code should be on the parts you wrote.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 7: Process Synchronization Background The Critical-Section Problem Synchronization.
Chapter 5 Concurrency: Mutual Exclusion and Synchronization Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee.
Chapter 6 – Process Synchronisation (Pgs 225 – 267)
OPERATING SYSTEMS DESIGN AND IMPLEMENTATION Third Edition ANDREW S. TANENBAUM ALBERT S. WOODHULL Yan hao (Wilson) Wu University of the Western.
Chapter 5 Concurrency: Mutual Exclusion and Synchronization Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee.
1 VxWorks 5.4 Group A3: Wafa’ Jaffal Kathryn Bean.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 24 Critical Regions.
CS 241 Section Week #7 (10/22/09). Topics This Section  Midterm Statistics  MP5 Forward  Classical Synchronization Problems  Problems.
Concurrency in Shared Memory Systems Synchronization and Mutual Exclusion.
Copyright ©: Nahrstedt, Angrave, Abdelzaher1 Synchronization.
CS4315A. Berrached:CMS:UHD1 Process Synchronization Chapter 8.
SOCSAMS e-learning Dept. of Computer Applications, MES College Marampally INTERPROCESS COMMUNICATION AND SYNCHRONIZATION SYNCHRONIZATION.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 5: Process Synchronization.
CE Operating Systems Lecture 8 Process Scheduling continued and an introduction to process synchronisation.
Semaphores Chapter 6. Semaphores are a simple, but successful and widely used, construct.
6.1 Silberschatz, Galvin and Gagne ©2005 Operating System Principles 6.5 Semaphore Less complicated than the hardware-based solutions Semaphore S – integer.
Chapter 5 Concurrency: Mutual Exclusion and Synchronization Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee.
Interprocess Communication Race Conditions
Process Synchronization: Semaphores
Auburn University COMP 3500 Introduction to Operating Systems Synchronization: Part 4 Classical Synchronization Problems.
Background on the need for Synchronization
Process Synchronization
Classical Synchronization Problems
IS310 Hardware & Network Infrastructure Ronny L
HW1 and Synchronization & Queuing
143a discussion session week 3
MODERN OPERATING SYSTEMS Third Edition ANDREW S
Chapter 5: Process Synchronization (Con’t)
Critical Section and Critical Resources
Critical Section and Critical Resources
Process Synchronization
COMS Prelim 1 Review Session
Critical section problem
Semaphores Chapter 6.
Concurrency: Mutual Exclusion and Process Synchronization
Computer Science & Engineering Electrical Engineering
Chapter 6 Synchronization Principles
CSE 153 Design of Operating Systems Winter 19
Chapter 7: Synchronization Examples
CSE 542: Operating Systems
CSE 542: Operating Systems
Presentation transcript:

Tasks and Task Management : --Time-critical tasks --Contending tasks --Communicating tasks

fig_12_00 Time durations: vocabulary --Time can be absolute (real-world) or relative to another event --Intervals can be equal (same start/stop time) or of equal duration

table_12_00 RTOS timeliness constraints

fig_12_01 Example: tasks in a periodic time-based system jitter = variation in evoking event

fig_12_02 Example: tasks in an aperiodic system

fig_12_03 Simple schedule—asynchronous, interrupt-driven Stays infinite loop until interrupt occurs Difficult to analyze

fig_12_04 Another simple scheme: based on polling

fig_12_05 State-based scheme; implement as case statement, e.g.

fig_12_26a Task scheduling: some algorithms used in practice None is optimal, since these are “on-line” decisions

fig_12_26b

fig_12_26c

fig_12_07 Typical behavior: “bursts” of activity (CPU or I/O)

tableun_12_00 Example burst times

fig_12_08 Managing communicating tasks: Basic paradigm

fig_12_09 Example: shared buffer Need guard statements—what if buffer is full / empty?

fig_12_10 Tasks sharing two buffers

fig_12_11 Code for sharing two buffers

fig_12_14 Ring buffer (FIFO)—allows simultaneous input and output

fig_12_15 “Mailbox”—like polling but “pend” suspends task and gives up CPU until data is available

fig_12_16 Task communication: direct message-passing

fig_12_17 Task communication: over a network

fig_12_18 Example: producer / consumer

fig_12_21 Indirect communication—tasks share remote mailbox, e.g.

fig_12_22 Using a buffering scheme for task communication: manages system if buffer has bounded capacity

fig_12_23 Task management: Sharing “critical section”: --Only one task can use the section --it cannot be interrupted while in the critical section “sharing” (rock)

fig_12_26 Tasks sharing a buffer

fig_12_27 Modeling the producer-consumer exchange

fig_12_29 Pseudocode & c code

Critical section management: requirements: 1.Mutual exclusion 2.No deadlock 3.Must be progress through critical section 4.Must have bounded waiting

fig_12_30 Model of a critical section and an atomic wait statement with flags:

fig_12_32a Producer code

fig_12_32b Consumer code

fig_12_33 Using a token to manage critical section access: This works but adds

fig_12_34 Using interrupts

fig_12_35 Semaphore: modeling behavior

fig_12_36 Using semaphore to protect critical section:

fig_12_38 Using a counting semaphore

Classical problem: dining philosophers

fig_12_39 Bounded buffer problem

fig_12_40 Producer-consumer

fig_12_42 reader-writer