Topic 6 (M 18) RTOS & Inter-process Communication

Size: px
Start display at page:

Download "Topic 6 (M 18) RTOS & Inter-process Communication"

Transcription

1 Topic 6 (M 18) RTOS & Inter-process Communication 6.1 Concepts of RTOS, Need of RTOS in Embedded systems 6.2 Multitasking 6.3 Task synchronization & Mutual Exclusion 6.4 Starvation, Deadlock, Multiple process 6.5 Basics of Inter-process Communication Concepts of RTOS Real-Time Operating System (RTOS) is a multitasking operating system intended for real-time applications. WIKIPEDIA. RTOS is implemented in products all around us, ranging from military, and consumer to scientific applications. RTOS comprises of two components, namely, Real-Time and Operating System. Real-Time Real-Time indicates an expectant response or reaction to an event on the instant of its evolution. The expectant response depicts the logical correctness of the result produced. The instant of the events evolution depicts deadline for producing the result. Operating System Operating System (OS) is a system program that provides an interface between hardware and application programs. OS is commonly equipped with features like: Multitasking, Synchronization, Interrupt and Event Handling, Input/ Output, Inter-task Communication, Timers and Clocks and Memory Management to fulfill its primary role of managing the hardware resources to meet the demands of application programs. RTOS is therefore an operating system that supports real-time applications and embedded systems by providing logically correct result within the deadline required. Such capabilities define its deterministic timing behavior and limited resource utilization nature. Why RTOS for Real-Time Application RTOS is not a required component of all real-time application in embedded systems. An embedded system in a simple electronic rice cooker does not require RTOS.

2 But as the complexity of applications expands beyond simple tasks, benefits of having an RTOS far outweigh the associate costs. Embedded systems are becoming more complex hardware-wise with every generation. And as more features are put into them in each iteration, application programs running on the embedded system platforms will become increasingly complex to be managed as they strive to meet the system response requirements. An RTOS will be effective to allow the real-time applications to be designed and expanded more easily whilst meeting the performances required. Features of RTOS The design of an RTOS is essentially a balance between providing a reasonably rich feature set for application development and deployment and, not sacrificing predictability and timeliness. A basic RTOS will be equipped with the following features: i. Multitasking and Preemptibility An RTOS must be multi-tasked and preemptible to support multiple tasks in real-time applications. The scheduler should be able to preempt any task in the system and allocate the resource to the task that needs it most even at peak load. ii. Task Priority Preemption defines the capability to identify the task that needs a resource the most and allocates it the control to obtain the resource. In RTOS, such capability is achieved by assigning individual task with the appropriate priority level. Thus, it is important for RTOS to be equipped with this feature. iii. Reliable and Sufficient Inter Task Communication Mechanism For multiple tasks to communicate in a timely manner and to ensure data integrity among each other, reliable and sufficient inter-task communication and synchronization mechanisms are required. iv. Priority Inheritance To allow applications with stringent priority requirements to be implemented, RTOS must have a sufficient number of priority levels when using priority scheduling. v. Predefined Short Latencies An RTOS needs to have accurately defined short timing of its system calls. The behavior metrics are:

3 Task switching latency: The time needed to save the context of a currently executing task and switching to another task is desirable to be short. Interrupt latency: The time elapsed between execution of the last instruction of the interrupted task and the first instruction in the interrupt handler. Interrupt dispatch latency. The time from the last instruction in the interrupt handler to the next task scheduled to run. vi. Control of Memory Management To ensure predictable response to an interrupt, an RTOS should provide way for task to lock its code and data into real memory. Task Synchronization Synchronization is essential for tasks to share mutually exclusive resources (devices, buffers, etc) and/or allow multiple concurrent tasks to be executed (e.g. Task A needs a result from task B, so task A can only run till task B produces it). Task synchronization is achieved using two types of mechanisms; 1) Event Objects and 2) Semaphores. Event objects are used when task synchronization is required without resource sharing. They allow one or more tasks to keep waiting for a specified event to occur. An event object can exist in either of two states: triggered and non-triggered. An event object in a triggered state indicates that a waiting task may resume. In contrast, if the event object is in a nontriggered state, a waiting task will need to stay suspended. Deadlock: A deadlock, also called as deadly embrace, is a situation in which two threads are each unknowingly waiting for resource held by other. o Assume thread T1 has exclusive access to resource R1. othread T2

4 has exclusive access to resource R2. o If T1 needs exclusive access to R2 and T2 needs exclusive access to R1, o Neither thread can continue. othey are deadlocked. othe simplest way to avoid a deadlock is for threads to: Acquire all resources before proceeding Acquire the resources in the same order Release the resource in the revere order How to Prevent deadlock: Deadlock is the situation in which multiple concurrent threads of execution in a system are blocked permanently because of resources requirement that can never be satisfied. A typical real-time system has multiple types of resources and multiple concurrent threads of execution contending for these resources. Each thread of execution can acquire multiple resources of various types throughout its lifetime. Potential for deadlock exist in a system in which the underlying RTOS permits resources sharing among multiple threads of execution. Following is a deadlock situation between two tasks. Task Synchronization Synchronization is essential for tasks to share mutually exclusive resources (devices, buffers, etc) and/or allow multiple concurrent tasks to be executed (e.g. Task A needs a result from task B, so task A can only run till task B produces it). Task synchronization is achieved using two types of mechanisms: a) Event Objects b) Semaphores a) Event objects : Event objects are used when task synchronization is required without resource sharing. They allow one or more tasks to keep waiting for a specified event to occur. Event

5 object can exist either in triggered or non-triggered state. Triggered state indicates resumption of the task. b) b) Semaphores :A semaphore functions like a key that define whether a task has the access to the resource. A task gets an access to the resource when it acquires the semaphore. A semaphore has an associated resource count and a wait queue. The resource count indicates availability of resource. The wait queue manages the tasks waiting for resources from the semaphore. There are three types of semaphore: Binary Semaphores Counting Semaphores Mutually Exclusion(Mutex) Semaphores What is intertask communication Intertask/Inter process communication is the set of techniques for exchanging the data among multiple threads in one or more processes. Inter process communication techniques are divided into

6 methods for message passing, synchronization, shared memory and remote procedure calls. The method of IPC may vary based on bandwidth and latency of communication between the threads, and the type of data being communicated Methods are as follows: 1. Message Queue 2. Pipeline 3. Remote procedure call 4. Semaphore 5. Signal Starvation: Starvation: Starvation is a resource management problem where a process does not get the resources it needs for a long time because the resources are being allocated to other processes. Starvation generally occurs in a Priority based scheduling System. Where High Priority (Lower Number = Higher Priority) requests get processed first. Thus a request with least priority may never be processed. For example: Consider priority based scheduling with scheduling criteria as the shortest process first. In a ready queue where all the processes are waiting for CPU, shortest process will be selected first. If there is a continuous supply of shortest process then the longer process may never get scheduled on CPU which leads to its starvation. Multitasking concept in Real Time Operating System (RTOS): Multitasking is a concept of performing multiple tasks (also known as processes) over a certain period of time by executing them concurrently. Embedded system are generally specific but need to perform many task for same application let us consider example of grinding control machine A simple microcontroller program can only do one thing at a time. However, because it can do things very fast (millions of operations per second), it can be made to switch between tasks so fast that it gives an illusion of doing several things concurrently. The question is, how do you program it so it will divide its attention between multiple tasks, Round robin and round robin with interrupts are ways to achieves the multitasking Imagine now a program with 25 steps in the main function plus 5

7 sub-functions (heating water, updating the display, watching 3 push buttons). Suppose some of those sub-functions also contain a number of steps with delays. Very, very quickly the complexity of the program becomes quite impossible to untangle. Assignment 1. What is deadlock? How can it be prevented? 2. What is task synchronization? How is it achieved? 3. Explain the features of RTOS. State how it differs from general operating system 4. What is intertask communication? State various mechanisms to achieve it. 5. Describe starvation with example

REAL TIME OPERATING SYSTEMS. Lesson-10:

REAL TIME OPERATING SYSTEMS. Lesson-10: REAL TIME OPERATING SYSTEMS Lesson-10: Real Time Operating System 1 1. Real Time Operating System Definition 2 Real Time A real time is the time which continuously increments at regular intervals after

More information

Priority Inversion Problem and Deadlock Situations

Priority Inversion Problem and Deadlock Situations INTER-PROCESS COMMUNICATION AND SYNCHRONISATION: Lesson-11: Priority Inversion Problem and Deadlock Situations 1 1. Priority Inversion 2 Assume Priorities of tasks be in an order such that task I highest

More information

EE458 - Embedded Systems Lecture 5 Intro to RTOSes

EE458 - Embedded Systems Lecture 5 Intro to RTOSes EE458 - Embedded Systems Lecture 5 Intro to RTOSes Outline RTOS Components Multitasking Objects Services Key Characteristics of an RTOS RTEMS Key Concepts References RTC: Chapter 4 CUG: Chapter 2 1 Introduction

More information

Chapter 2: OS Overview

Chapter 2: OS Overview Chapter 2: OS Overview CmSc 335 Operating Systems 1. Operating system objectives and functions Operating systems control and support the usage of computer systems. a. usage users of a computer system:

More information

Deciding which process to run. (Deciding which thread to run) Deciding how long the chosen process can run

Deciding which process to run. (Deciding which thread to run) Deciding how long the chosen process can run SFWR ENG 3BB4 Software Design 3 Concurrent System Design 2 SFWR ENG 3BB4 Software Design 3 Concurrent System Design 11.8 10 CPU Scheduling Chapter 11 CPU Scheduling Policies Deciding which process to run

More information

Performance Comparison of RTOS

Performance Comparison of RTOS Performance Comparison of RTOS Shahmil Merchant, Kalpen Dedhia Dept Of Computer Science. Columbia University Abstract: Embedded systems are becoming an integral part of commercial products today. Mobile

More information

Chapter 3. Hsung-Pin Chang Department of Computer Science National Chung Hsing University

Chapter 3. Hsung-Pin Chang Department of Computer Science National Chung Hsing University Chapter 3 Real-Time Operating System Overview Hsung-Pin Chang Department of Computer Science National Chung Hsing University Outline 3.1 What Is an Operating System? 3.2 What is an Embedded Operating System?

More information

Embedded Systems. Chapter 6. Real-Time Operating System

Embedded Systems. Chapter 6. Real-Time Operating System Embedded Systems Chapter 6 Real-Time Operating System 6. Real-Time Operating System [8 Hrs.] 6.1 Operating System Basics 6.2 Task, Process, and Threads 6.3 Multiprocessing and Multitasking 6.4 Task Scheduling

More information

Embedded Systems. Real Time Systems (Part I) Real Time Operating System (RTOS) Definition and Characteristics

Embedded Systems. Real Time Systems (Part I) Real Time Operating System (RTOS) Definition and Characteristics Embedded Systems Real Time Systems (Part I) Dr. Jeff Jackson Lecture 12-1 Real Time Operating System (RTOS) Definition and Characteristics A real-time operating system (RTOS) is an operating system (OS)

More information

Module 8. Industrial Embedded and Communication Systems. Version 2 EE IIT, Kharagpur 1

Module 8. Industrial Embedded and Communication Systems. Version 2 EE IIT, Kharagpur 1 Module 8 Industrial Embedded and Communication Systems Version 2 EE IIT, Kharagpur 1 Lesson 37 Real-Time Operating Systems: Introduction and Process Management Version 2 EE IIT, Kharagpur 2 Instructional

More information

CPU Scheduling. Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling

CPU Scheduling. Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Basic Concepts An OS must allocate resources amongst competing processes The resource

More information

Outline. V Computer Systems Organization II (Honors) (Introductory Operating Systems) CPU Scheduling: Overview. Scheduling: Components

Outline. V Computer Systems Organization II (Honors) (Introductory Operating Systems) CPU Scheduling: Overview. Scheduling: Components Outline V22.0202-001 Computer Systems Organization II (Honors) (Introductory Operating Systems) Lecture 10 CPU Scheduling February 23, 2005 Announcements Lab 3 due on March 2 nd, Demos on March 2 nd and

More information

CPU SCHEDULING. Scheduling Objectives. Outline. Basic Concepts. Enforcement of fairness in allocating resources to processes

CPU SCHEDULING. Scheduling Objectives. Outline. Basic Concepts. Enforcement of fairness in allocating resources to processes Scheduling Objectives CPU SCHEDULING Enforcement of fairness in allocating resources to processes Enforcement of priorities Make best use of available system resources Give preference to processes holding

More information

COMPLEX EMBEDDED SYSTEMS

COMPLEX EMBEDDED SYSTEMS COMPLEX EMBEDDED SYSTEMS Real-Time Scheduling Summer Semester 2012 System and Software Engineering Prof. Dr.-Ing. Armin Zimmermann Contents Introduction Scheduling in Interactive Systems Real-Time Scheduling

More information

W4118 Operating Systems. Instructor: Junfeng Yang

W4118 Operating Systems. Instructor: Junfeng Yang W4118 Operating Systems Instructor: Junfeng Yang Outline Introduction to scheduling Scheduling algorithms 1 Direction within course Until now: interrupts, processes, threads, synchronization Mostly mechanisms

More information

What Is an RTOS and Why U se Use One? May, May 2013

What Is an RTOS and Why U se Use One? May, May 2013 What Is an RTOS and Why Use One? May, 2013 What is an Embedded System? Dedicated to a specific purpose Components: Microprocessor Application program Real-Time Operating System (RTOS) RTOS and application

More information

CPU Scheduling: Basic Concepts

CPU Scheduling: Basic Concepts CPU Scheduling: Basic Concepts Idea: Maximum CPU utilization obtained with multiprogramming" CPU I/O Burst Cycle Process execution consists of a cycle of CPU execution and I/O wait" Dispatcher grants CPU

More information

Definition of Multitasking

Definition of Multitasking Definition of Multitasking 1. Running number of programs simultaneously: the simultaneous management of two or more tasks by a computer or a person 2. Differences between computers and humans a. Information

More information

OPERATING SYSTEMS SCHEDULING

OPERATING SYSTEMS SCHEDULING OPERATING SYSTEMS SCHEDULING Jerry Breecher 5: CPU- 1 CPU What Is In This Chapter? This chapter is about how to get a process attached to a processor. It centers around efficient algorithms that perform

More information

ESD2531- Embedded RTOS

ESD2531- Embedded RTOS ESD2531- Embedded RTOS Module Leader Deepak V. 1 Module Aims and Summary This module intends to prepare students to design and develop the embedded software using Real-Time Operating System (RTOS). Students

More information

How Embedded Applications using an RTOS can stay within On-chip Memory Limits

How Embedded Applications using an RTOS can stay within On-chip Memory Limits How Embedded Applications using an RTOS can stay within On-chip Memory Limits Robert Davis Nick Merriam Nigel Tracey Realogy Realogy University of York rdavis@realogy.com nmerriam@realogy.com njt@cs.york.ac.uk

More information

EEE499 - Real-Time Embedded System Design. Introduction to Real-Time Operating Systems Part 1

EEE499 - Real-Time Embedded System Design. Introduction to Real-Time Operating Systems Part 1 EEE499 - Real-Time Embedded System Design Introduction to Real-Time Operating Systems Part 1 Outline Typical Real-Time System Hardware Why Operating Systems? Basic Requirements of an RTOS Characteristics

More information

Chapter 2 Operating System Overview

Chapter 2 Operating System Overview Operating Systems: Internals and Design Principles, 6/E William Stallings Chapter 2 Operating System Overview Dave Bremer Otago Polytechnic, N.Z. 2008, Prentice Hall Roadmap Operating System Objectives/Functions

More information

Lecture 8: Scheduling & Deadlock

Lecture 8: Scheduling & Deadlock Project 1 Due Thursday 10/20 Lecture 8: Scheduling & Deadlock CSE 120: Principles of Operating Systems Alex C. Snoeren Scheduling Overview In discussing process management and synchronization, we talked

More information

Tasks Schedule Analysis in RTAI/Linux-GPL

Tasks Schedule Analysis in RTAI/Linux-GPL Tasks Schedule Analysis in RTAI/Linux-GPL Claudio Aciti and Nelson Acosta INTIA - Depto de Computación y Sistemas - Facultad de Ciencias Exactas Universidad Nacional del Centro de la Provincia de Buenos

More information

CS 571 Operating Systems. CPU Scheduling. Angelos Stavrou, George Mason University

CS 571 Operating Systems. CPU Scheduling. Angelos Stavrou, George Mason University CS 571 Operating Systems CPU Scheduling Angelos Stavrou, George Mason University CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms First-Come-First-Served Shortest-Job-First, Shortest-remaining-Time-First

More information

5) One class of services provided by an operating system is to provide new functionality that is not supported directly by the underlying hardware.

5) One class of services provided by an operating system is to provide new functionality that is not supported directly by the underlying hardware. Benha University 2 nd Term (May 2014) Final Exam Class: 3 rd Year Students Subject: Operating Systems Faculty of Computers & Informatics Date: 17/5/2014 Time: 3 hours Answer the following questions:- Question

More information

Chapter 6: CPU Scheduling. Operating System Concepts Essentials 2 nd Edition

Chapter 6: CPU Scheduling. Operating System Concepts Essentials 2 nd Edition Chapter 6: CPU Scheduling Silberschatz, Galvin and Gagne 2013 Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Thread Scheduling Multiple-Processor Scheduling Real-Time

More information

LabVIEW Real-Time and Embedded

LabVIEW Real-Time and Embedded FYS3240 PC-based instrumentation and microcontrollers LabVIEW Real-Time and Embedded Spring 2011 Lecture #10 Bekkeng, 11.5.2011 Embedded Computing An embedded system is a computer system designed to perform

More information

Page 1 of 5. IS 335: Information Technology in Business Lecture Outline Operating Systems

Page 1 of 5. IS 335: Information Technology in Business Lecture Outline Operating Systems Lecture Outline Operating Systems Objectives Describe the functions and layers of an operating system List the resources allocated by the operating system and describe the allocation process Explain how

More information

Real-Time & Embedded Operating Systems. VO Embedded Systems Engineering Benedikt Huber WS 2010/11

Real-Time & Embedded Operating Systems. VO Embedded Systems Engineering Benedikt Huber WS 2010/11 Real-Time & Embedded Operating Systems VO Embedded Systems Engineering Benedikt Huber WS 2010/11 Overview Real-Time Systems (Review) OS and RTOS RTOS Classification Linux as RTOS Programming Considerations

More information

RTOS Real-Time Operating System

RTOS Real-Time Operating System RTOS Real-Time Operating System What is a real-time system? A real-time system is any information processing system which has to respond to externally generated input stimuli within a finite and specified

More information

SYSTEM ecos Embedded Configurable Operating System

SYSTEM ecos Embedded Configurable Operating System BELONGS TO THE CYGNUS SOLUTIONS founded about 1989 initiative connected with an idea of free software ( commercial support for the free software ). Recently merged with RedHat. CYGNUS was also the original

More information

Operating Systems OBJECTIVES 7.1 DEFINITION. Chapter 7. Note:

Operating Systems OBJECTIVES 7.1 DEFINITION. Chapter 7. Note: Chapter 7 OBJECTIVES Operating Systems Define the purpose and functions of an operating system. Understand the components of an operating system. Understand the concept of virtual memory. Understand the

More information

OPERATING SYSTEMS. IIIT-Hyderabad

OPERATING SYSTEMS. IIIT-Hyderabad OPERATING SYSTEMS IIIT-Hyderabad OVERVIEW Introduction What is an OS/Kernel? Bootstrap program Interrupts and exceptions Volatile and Non volatile storage!!! Process Management What is a process/system

More information

The Nature of Program Executions

The Nature of Program Executions Processor Scheduling 1 The Nature of Program Executions A running thread can be modeled as alternating series of CPU bursts and I/O bursts during a CPU burst, a thread is executing instructions during

More information

Chapter 6: CPU Scheduling

Chapter 6: CPU Scheduling 1 Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation 6.1 2 Basic Concepts Maximum CPU utilization

More information

Chapter 13 Embedded Operating Systems

Chapter 13 Embedded Operating Systems Operating Systems: Internals and Design Principles Chapter 13 Embedded Operating Systems Eighth Edition By William Stallings Embedded System Refers to the use of electronics and software within a product

More information

Processor Scheduling. Queues Recall OS maintains various queues

Processor Scheduling. Queues Recall OS maintains various queues Processor Scheduling Chapters 9 and 10 of [OS4e], Chapter 6 of [OSC]: Queues Scheduling Criteria Cooperative versus Preemptive Scheduling Scheduling Algorithms Multi-level Queues Multiprocessor and Real-Time

More information

The Nature of Program Executions

The Nature of Program Executions Processor Scheduling 1 The Nature of Program Executions A running thread can be modeled as alternating series of CPU bursts and I/O bursts during a CPU burst, a thread is executing instructions during

More information

Chapter 6: CPU Scheduling. Basic Concepts

Chapter 6: CPU Scheduling. Basic Concepts 1 Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation 6.1 Basic Concepts Maximum CPU utilization obtained

More information

RTOS Real-Time Operating Systems. Chenyang Lu

RTOS Real-Time Operating Systems. Chenyang Lu RTOS Real-Time Operating Systems Chenyang Lu OS Support for Real-Time Ø Real-Time OS Ø Real-time extensions to general-purpose OS Chenyang Lu 19 RTOS: Features for Efficiency Ø Small Ø Minimal set of functionality

More information

Process Scheduling CS 241. February 24, 2012. Copyright University of Illinois CS 241 Staff

Process Scheduling CS 241. February 24, 2012. Copyright University of Illinois CS 241 Staff Process Scheduling CS 241 February 24, 2012 Copyright University of Illinois CS 241 Staff 1 Announcements Mid-semester feedback survey (linked off web page) MP4 due Friday (not Tuesday) Midterm Next Tuesday,

More information

Operating Systems Fall 2012 Lecture 4: CPU Scheduling

Operating Systems Fall 2012 Lecture 4: CPU Scheduling 482000000000357 Operating Systems Fall 2012 Lecture 4: CPU Scheduling Assist. Prof. Ediz ŞAYKOL ediz.saykol@beykent.edu.tr Operating System - Main Goals Interleave the execution of the number of processes

More information

OPERATING SYSTEMS (OPS)

OPERATING SYSTEMS (OPS) Computing Curricula - Computer Engineering Body of Knowledge 1 OPERATING SYSTEMS (OPS) OPS0. History and overview of operating systems [core] OPS1. Operating system function and design [core] OPS2. Operating

More information

Lecture 2 General Concepts of RTOS (Real-Time Operating System)

Lecture 2 General Concepts of RTOS (Real-Time Operating System) CENG 383 Real-Time Systems Lecture 2 General Concepts of RTOS (Real-Time Operating System) Asst. Prof. Tolga Ayav, Ph.D. Department of Computer Engineering Operating System Specialized collection of system

More information

Chapter 6 CPU Scheduling. Processor Scheduling

Chapter 6 CPU Scheduling. Processor Scheduling Chapter 6 CPU Scheduling Processor Scheduling Known as the dispatcher Invoked when an event occurs Clock interrupts I/O interrupts Operating system calls Signals 1 Aim of Scheduling Assign processes to

More information

Chapter 6 Concurrency: Deadlock and Starvation

Chapter 6 Concurrency: Deadlock and Starvation Operating Systems: Internals and Design Principles, 6/E William Stallings Chapter 6 Concurrency: Deadlock and Starvation Dave Bremer Otago Polytechnic, N.Z. 2008, Prentice Hall Roadmap Principals of Deadlock

More information

Threads (Ch.4) ! Many software packages are multi-threaded. ! A thread is sometimes called a lightweight process

Threads (Ch.4) ! Many software packages are multi-threaded. ! A thread is sometimes called a lightweight process Threads (Ch.4)! Many software packages are multi-threaded l Web browser: one thread display images, another thread retrieves data from the network l Word processor: threads for displaying graphics, reading

More information

Chapter 6: CPU Scheduling. Basic Concepts Scheduling Criteria Scheduling Algorithms

Chapter 6: CPU Scheduling. Basic Concepts Scheduling Criteria Scheduling Algorithms Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Operating System Concepts 6.1 Basic Concepts Maximum CPU utilization obtained with multiprogramming. CPU I/O Burst Cycle

More information

Real-Time Operating Systems Lecture for the Embedded Systems Course CSD, University of Crete (May 23, 2014)

Real-Time Operating Systems Lecture for the Embedded Systems Course CSD, University of Crete (May 23, 2014) Real-Time Operating Systems Lecture for the Embedded Systems Course CSD, University of Crete (May 23, 2014) ManolisMarazakis (maraz@ics.forth.gr) Institute of Computer Science (ICS) Foundation for Research

More information

CPU I/O Burst Cycle Process execution consists of a cycle of CPU execution and I/O wait

CPU I/O Burst Cycle Process execution consists of a cycle of CPU execution and I/O wait Unit II Process Scheduling and Synchronization Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Thread Scheduling Operating Systems Examples Java

More information

Embedded Systems. 6. Real-Time Operating Systems

Embedded 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 information

Chapter 5: Process Scheduling. Chapter 5: Process Scheduling

Chapter 5: Process Scheduling. Chapter 5: Process Scheduling Chapter 5: Process Scheduling Chapter 5: Process Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Operating Systems Examples Java Thread Scheduling Algorithm

More information

CPU Scheduling! Basic Concepts! Scheduling Criteria! Scheduling Algorithms!

CPU Scheduling! Basic Concepts! Scheduling Criteria! Scheduling Algorithms! CPU Scheduling! Basic Concepts! Scheduling Criteria! Scheduling Algorithms! First-Come-First-Served! Shortest-Job-First, Shortest-remaining-Time-First! Priority Scheduling! Round Robin! Multi-level Queue!

More information

Lesson-12: Inter process communication

Lesson-12: Inter process communication INTER-PROCESS COMMUNICATION AND SYNCHRONISATION: Lesson-12: Inter process communication 1 1. Inter Process Communication 2 Inter Processor Communication Inter processor communication in a multiprocessor

More information

CPU Scheduling. CPU Scheduling

CPU Scheduling. CPU Scheduling CPU Scheduling Electrical and Computer Engineering Stephen Kim (dskim@iupui.edu) ECE/IUPUI RTOS & APPS 1 CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling

More information

PROCESS SCHEDULING. CS124 Operating Systems Winter 2013-2014, Lecture 12

PROCESS SCHEDULING. CS124 Operating Systems Winter 2013-2014, Lecture 12 PROCESS SCHEDULING CS124 Operating Systems Winter 2013-2014, Lecture 12 2 Process Scheduling OSes must manage the allocation and sharing of hardware resources to applications that use them Most important

More information

Objectives. Chapter 5: CPU Scheduling. CPU Scheduler. Non-preemptive and preemptive. Dispatcher. Alternating Sequence of CPU And I/O Bursts

Objectives. Chapter 5: CPU Scheduling. CPU Scheduler. Non-preemptive and preemptive. Dispatcher. Alternating Sequence of CPU And I/O Bursts Objectives Chapter 5: CPU Scheduling Introduce CPU scheduling, which is the basis for multiprogrammed operating systems Describe various CPU-scheduling algorithms Discuss evaluation criteria for selecting

More information

Chapter 6: CPU Scheduling

Chapter 6: CPU Scheduling Chapter 6: CPU Scheduling Edited by Ghada Ahmed, PhD ghada@fcih.net Silberschatz, Galvin and Gagne 2013 Basic Concepts Maximum CPU utilization obtained with multiprogramming CPU I/O Burst Cycle Process

More information

Lecture Outline Overview of real-time scheduling algorithms Outline relative strengths, weaknesses

Lecture Outline Overview of real-time scheduling algorithms Outline relative strengths, weaknesses Overview of Real-Time Scheduling Embedded Real-Time Software Lecture 3 Lecture Outline Overview of real-time scheduling algorithms Clock-driven Weighted round-robin Priority-driven Dynamic vs. static Deadline

More information

Scheduling Criteria. response time/turnaround time: time required to finish a task

Scheduling Criteria. response time/turnaround time: time required to finish a task Processor Scheduling 1 Scheduling Criteria CPU utilization: keep the CPU as busy as possible throughput: rate at which tasks are completed response time/turnaround time: time required to finish a task

More information

Objectives. Chapter 5: CPU Scheduling. CPU Scheduler. Alternating Sequence of CPU And I/O Bursts

Objectives. Chapter 5: CPU Scheduling. CPU Scheduler. Alternating Sequence of CPU And I/O Bursts Objectives Chapter 5: CPU Scheduling Introduce CPU scheduling, which is the basis for multiprogrammed operating systems Describe various CPU-scheduling algorithms Discuss evaluation criteria for selecting

More information

Chapter 6: CPU Scheduling

Chapter 6: CPU Scheduling Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Thread Scheduling Multiple-Processor Scheduling 1.1 Maximum CPU utilization obtained with multiprogramming CPU I/O Burst

More information

II. Operating Systems and Processes!

II. Operating Systems and Processes! II. Operating Systems and Processes! Computer Architecture & Operating Systems: 725G84 Ahmed Rezine What is an Operating System? A program that acts as an intermediary between a user of a computer and

More information

Real-Time Scheduling 1 / 39

Real-Time Scheduling 1 / 39 Real-Time Scheduling 1 / 39 Multiple Real-Time Processes A runs every 30 msec; each time it needs 10 msec of CPU time B runs 25 times/sec for 15 msec C runs 20 times/sec for 5 msec For our equation, A

More information

Process and Thread Scheduling. Raju Pandey Department of Computer Sciences University of California, Davis Winter 2005

Process and Thread Scheduling. Raju Pandey Department of Computer Sciences University of California, Davis Winter 2005 Process and Thread Scheduling Raju Pandey Department of Computer Sciences University of California, Davis Winter 2005 Scheduling Context switching an interrupt occurs (device completion, timer interrupt)

More information

THE UNIVERSITY OF AUCKLAND

THE UNIVERSITY OF AUCKLAND THE UNIVERSITY OF AUCKLAND 07.340 T07.340 EXAMINATION FOR BA BSc ETC 1995 COMPUTER SCIENCE Operating Systems ( Time allowed : THREE hours ) NOTES: Answer SIX questions. The total mark for each question

More information

CPU scheduling. CPU Scheduling. No.4. CPU burst vs. I/O burst. Prof. Hui Jiang Dept of Electrical Engineering and Computer Science, York University

CPU scheduling. CPU Scheduling. No.4. CPU burst vs. I/O burst. Prof. Hui Jiang Dept of Electrical Engineering and Computer Science, York University EECS 3221 Operating System Fundamentals No.4 CPU scheduling Prof. Hui Jiang Dept of Electrical Engineering and Computer Science, York University CPU Scheduling CPU scheduling is the basis of multiprogramming

More information

Scheduling Criteria. A task might be a single CPU burst, a thread, or an applicationlevel service request. The Nature of Program Executions

Scheduling Criteria. A task might be a single CPU burst, a thread, or an applicationlevel service request. The Nature of Program Executions Processor Scheduling 1 Scheduling Criteria CPU utilization: keep the CPU as busy as possible throughput: rate at which tasks are completed response time/turnaround time: time required to finish a task

More information

Chapter 6 CPU Scheduling. Contents

Chapter 6 CPU Scheduling. Contents Contents 1. Introduction 2. Computer-System Structures 3. Operating-System Structures 4. Processes 5. Threads 6. CPU Scheduling 7. Process Synchronization 8. Deadlocks 9. Memory Management 10. Virtual

More information

multiple processes are kept in memory simultaneously when one process is waiting, another process executes

multiple processes are kept in memory simultaneously when one process is waiting, another process executes Terminology. Reference: Section 4.2, 5.1 Time-sharing / multiprogramming Typical proc. alternates between CPU bursts and I/O bursts To maximize CPU utilization: multiple processes are kept in memory simultaneously

More information

Process Management. Processes. CS 502 Spring 99 WPI MetroWest/Southboro Campus

Process Management. Processes. CS 502 Spring 99 WPI MetroWest/Southboro Campus Process Management CS 502 Spring 99 WPI MetroWest/Southboro Campus Processes Process Concept Process Scheduling Operations on Processes Cooperating Processes Threads Interprocess Communication 1 1 Process

More information

Chapter 12. Development Tools for Microcontroller Applications

Chapter 12. Development Tools for Microcontroller Applications Chapter 12 Development Tools for Microcontroller Applications Lesson 01 Software Development Process and Development Tools Step 1: Development Phases Analysis Design Implementation Phase 1 Phase 2 Phase

More information

Chapter 5: CPU Scheduling

Chapter 5: CPU Scheduling Chapter 5: CPU Scheduling Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Thread Scheduling Operating Systems Examples

More information

Embedded systems are inventions that have taken more than a hundred years to evolve

Embedded systems are inventions that have taken more than a hundred years to evolve Chapter 5 RTOS SELECTION 5.1 Introduction Embedded systems are inventions that have taken more than a hundred years to evolve into the present shape. The way they have manifested themselves in our lives,

More information

Operating Systems 4 th Class

Operating Systems 4 th Class Operating Systems 4 th Class Lecture 1 Operating Systems Operating systems are essential part of any computer system. Therefore, a course in operating systems is an essential part of any computer science

More information

Chapter 6: CPU Scheduling. Previous Lectures. Basic Concepts. Alternating Sequence of CPU And I/O Bursts

Chapter 6: CPU Scheduling. Previous Lectures. Basic Concepts. Alternating Sequence of CPU And I/O Bursts Previous Lectures Multithreading Memory Layout Kernel vs User threads Representation in OS Difference between thread and process Thread scheduling Mapping between user and kernel threads Multithreading

More information

Chapter 1 FUNDAMENTALS OF OPERATING SYSTEM

Chapter 1 FUNDAMENTALS OF OPERATING SYSTEM Chapter 1 FUNDAMENTALS OF OPERATING SYSTEM An operating system is a program that acts as an intermediary between a user of a computer and the computer hardware. The purpose of an operating system is to

More information

Operating Systems for Embedded Computers

Operating Systems for Embedded Computers University of Zagreb Faculty of Electrical Engineering and Computing Department of Electronics, Microelectronics, Computer and Intelligent Systems Operating Systems for Embedded Computers Summary of textbook:

More information

The Real-Time Operating System ucos-ii

The Real-Time Operating System ucos-ii The Real-Time Operating System ucos-ii Enric Pastor Dept. Arquitectura de Computadors µc/os-ii Overview µc/os-ii Task Management Rate Monotonic Scheduling Memory Management µc/gui µc/fs Books and Resources

More information

CSC501 Operating Systems Principles. Process Scheduling

CSC501 Operating Systems Principles. Process Scheduling CSC501 Operating Systems Principles Process Scheduling 1 Last Lecture q Process Lifecycles q Context Switching 2 Process Scheduling q Key steps Q Examine processes eligible for execution Q Select one based

More information

ICS 143 - Principles of Operating Systems

ICS 143 - Principles of Operating Systems ICS 143 - Principles of Operating Systems Lecture 5 - CPU Scheduling Prof. Nalini Venkatasubramanian nalini@ics.uci.edu Note that some slides are adapted from course text slides 2008 Silberschatz. Some

More information

Why Linux is not an RTOS: porting hints

Why Linux is not an RTOS: porting hints Why Linux is not an RTOS: porting hints Chris Simmonds 2net Limited Embedded Systems Conference UK. 2009 Copyright 2009, 2net Limited Overview Linux is a popular choice as an embedded OS Most projects

More information

Achieving Nanosecond Latency Between Applications with IPC Shared Memory Messaging

Achieving Nanosecond Latency Between Applications with IPC Shared Memory Messaging Achieving Nanosecond Latency Between Applications with IPC Shared Memory Messaging In some markets and scenarios where competitive advantage is all about speed, speed is measured in micro- and even nano-seconds.

More information

Chapter 6: CPU Scheduling. Operating System Concepts 9 th Edition

Chapter 6: CPU Scheduling. Operating System Concepts 9 th Edition Chapter 6: CPU Scheduling Silberschatz, Galvin and Gagne 2013 Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Thread Scheduling Multiple-Processor Scheduling Real-Time

More information

Chapter 5: CPU Scheduling. Operating System Concepts 8 th Edition,

Chapter 5: CPU Scheduling. Operating System Concepts 8 th Edition, Chapter 5: CPU Scheduling, Silberschatz, Galvin and Gagne 2009 Objectives To introduce CPU scheduling, which is the basis for multiprogrammed operating systems To describe various scheduling algorithms

More information

CPU Scheduling. Basic Concepts. Basic Concepts. CPU Scheduler. Histogram of CPU-burst Times CPU. Alternating Sequence of CPU and I/O Bursts

CPU Scheduling. Basic Concepts. Basic Concepts. CPU Scheduler. Histogram of CPU-burst Times CPU. Alternating Sequence of CPU and I/O Bursts Basic Concepts P CPU Scheduling 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

More information

REAL TIME OPERATING SYSTEMS. Lesson-9:

REAL TIME OPERATING SYSTEMS. Lesson-9: REAL TIME OPERATING SYSTEMS Lesson-9: INTERRUPT ROUTINES IN RTOS ENVIRONMENT AND HANDLING OF INTERRUPT SOURCE CALLS 1 1. INTERRUPT ROUTINES IN RTOS 2 ISRs in RTOSes ISRs have the higher priorities over

More information

Midterm Review. System Software

Midterm Review. System Software CS 325 Principles of Operating Systems Midterm Review Dr. Xiao Qin New Mexico Tech http://www.cs.nmt.edu/~xqin xqin@cs.nmt.edu Spring, 2007 These slides are adapted from notes by Dr. Gary Nutt (University

More information

Chapter-2 2 Real-Time System Concepts. Dr. Li-Pin Chang Real-Time and Embedded System Lab. National Taiwan University

Chapter-2 2 Real-Time System Concepts. Dr. Li-Pin Chang Real-Time and Embedded System Lab. National Taiwan University Chapter-2 2 Real-Time System Concepts Dr. Li-Pin Chang Real-Time and Embedded System Lab. National Taiwan University Objectives To know essential topics on the design of: Embedded operating systems Real-time

More information

Chapter 5: CPU Scheduling

Chapter 5: CPU Scheduling Chapter 5: CPU Scheduling Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Thread Scheduling Operating Systems Examples

More information

Process Management Chapter 5 CPU Scheduling

Process Management Chapter 5 CPU Scheduling Part II Process Management Chapter 5 CPU Scheduling Fall 2010 1 CPU-I/O Burst Cycle CPU burst I/O burst CPU burst I/O burst CPU burst I/O burst CPU burst Process execution repeats the CPU burst and I/Ob

More information

10.04.2008. Thomas Fahrig Senior Developer Hypervisor Team. Hypervisor Architecture Terminology Goals Basics Details

10.04.2008. Thomas Fahrig Senior Developer Hypervisor Team. Hypervisor Architecture Terminology Goals Basics Details Thomas Fahrig Senior Developer Hypervisor Team Hypervisor Architecture Terminology Goals Basics Details Scheduling Interval External Interrupt Handling Reserves, Weights and Caps Context Switch Waiting

More information

GOJAN SCHOOL OF BUSINESS AND TECHNOLOGY DEPARTMENT OF INFORMATION TECHNOLOGY CS2411-OPERATING SYSTEM QUESTION BANK UNIT-I (PROCESSES AND THREADS)

GOJAN SCHOOL OF BUSINESS AND TECHNOLOGY DEPARTMENT OF INFORMATION TECHNOLOGY CS2411-OPERATING SYSTEM QUESTION BANK UNIT-I (PROCESSES AND THREADS) GOJAN SCHOOL OF BUSINESS AND TECHNOLOGY DEPARTMENT OF INFORMATION TECHNOLOGY CS2411-OPERATING SYSTEM QUESTION BANK UNIT-I (PROCESSES AND THREADS) 1. What is an Operating system? What are the various OS

More information

Chapter 5: CPU Scheduling

Chapter 5: CPU Scheduling Chapter 5: CPU Scheduling Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Thread Scheduling Operating Systems Examples

More information

Announcements Project #2. Basic Concepts

Announcements Project #2. Basic Concepts Announcements Project #2 Is due at 6:00 PM on Friday Program #3 Posted tomorrow (implements scheduler) Reading Chapter 6 Basic Concepts CPU I/O burst cycle Process execution consists of a cycle of CPU

More information

Scheduling for uniprocessor systems Introduction

Scheduling for uniprocessor systems Introduction Politecnico di Milano Introduction Lecturer: William Fornaciari Politecnico di Milano william.fornaciari@elet.polimi.it Home.dei.polimi.it/fornacia SUMMARY Basic Concepts Scheduling Criteria Scheduling

More information

CPU Scheduling. Chapter 5

CPU Scheduling. Chapter 5 CPU Scheduling Chapter 5 Basic Concepts Maximum CPU utilization obtained with multiprogramming CPU I/O Burst Cycle Process execution consists of a cycle of CPU execution and I/O wait CPU burst distribution

More information

Real Time Programming: Concepts

Real Time Programming: Concepts Real Time Programming: Concepts Radek Pelánek Plan at first we will study basic concepts related to real time programming then we will have a look at specific programming languages and study how they realize

More information