The Wayback Machine - https://web.archive.org/web/20240914125047/https://www.geeksforgeeks.org/tasks-in-real-time-systems/
Open In App

Tasks in Real Time systems

Last Updated : 31 Aug, 2023
Summarize
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

The system is subjected to real-time, i.e. response should be guaranteed within a specified timing constraint or system should meet the specified deadline. For example flight control systems, real-time monitors, etc. 

There are four types of tasks in real-time systems: 

  1. Periodic tasks
  2. Dynamic tasks
  3. Critical task
  4. Non-critical task
  • Periodic Tasks: In periodic tasks, jobs are released at regular intervals. A periodic task is one that repeats itself after a fixed time interval. A periodic task is denoted by four tuples: Ti = < Φi, Pi, ei, Di > 
    Where, 
    • Φi – is the phase of the task. Phase is the release time of the first job in the task. If the phase is not mentioned then the release time of the first job is assumed to be zero.
    • Pi – is the period of the task i.e. the time interval between the release times of two consecutive jobs.
    • ei – is the execution time of the task.
    • Di – is the relative deadline of the task.

For example: Consider the task Ti with period = 5 and execution time = 3
Phase is not given so, assume the release time of the first job as zero. So the job of this task is first released at t = 0 then it executes for 3s and then the next job is released at t = 5 which executes for 3s and then the next job is released at t = 10. So jobs are released at t = 5k where k = 0, 1, . . ., n

Interval real time

Hyper period of a set of periodic tasks is the least common multiple of periods of all the tasks in that set. For example, two tasks T1 and T2 having period 4 and 5 respectively will have a hyper period, H = lcm(p1, p2) = lcm(4, 5) = 20. The hyper period is the time after which pattern of job release times starts to repeat.

  • Dynamic Tasks: It is a sequential program that is invoked by the occurrence of an event. An event may be generated by the processes external to the system or by processes internal to the system. Dynamically arriving tasks can be categorized on their criticality and knowledge about their occurrence times. 
    1. Aperiodic Tasks: In this type of task, jobs are released at arbitrary time intervals i.e. randomly. Aperiodic tasks have soft deadlines or no deadlines.
    2. Sporadic Tasks: They are similar to aperiodic tasks i.e. they repeat at random instances. The only difference is that sporadic tasks have hard deadlines. A sporadic task is denoted by three tuples: Ti =(ei, gi, Di) 
      Where 
      ei – the execution time of the task. 
      gi – the minimum separation between the occurrence of two consecutive instances of the task. 
      Di – the relative deadline of the task.

  • Critical Tasks:

Critical Tasks are those whose opportune executions are basic. In the event that cutoff times are missed, calamities happen.

For instance, life-emotionally supportive networks and the steadiness control of airplane. On the off chance that basic errands are executed at a higher recurrence, it is fundamental.

  • Non-critical Tasks:

Non-critical Tasks are genuine times assignments. As the name infers, they are not basic to the application. Be that as it may, they can manage time, changing information, and consequently they are futile on the off chance that not finished inside a cutoff time. The objective of booking these assignments is to expand the level of occupations effectively executed inside their cutoff times.

Jitter: Sometimes actual release time of a job is not known. Only know that ri is in a range [ ri-, ri+ ]. This range is known as release time jitter. Here ri– is how early a job can be released and ri+ is how late a job can be released. Only the range [ ei-, ei+ ] of the execution time of a job is known. Here ei– is the minimum amount of time required by a job to complete its execution and ei+ is the maximum amount of time required by a job to complete its execution. 

Precedence Constraint of Jobs: Jobs in a task are independent if they can be executed in any order. If there is a specific order in which jobs in a task have to be executed then jobs are said to have precedence constraints. For representing precedence constraints of jobs a partial order relation < is used. This is called precedence relation. A job Ji is a predecessor of job Jj if Ji < Jj i.e. Jj cannot begin its execution until Ji completes. Ji is an immediate predecessor of Jj if Ji < Jj and there is no other job Jk such that Ji < Jk < Jj. Ji and Jj are independent if neither Ji < Jj nor Jj < Ji is true. 
An efficient way to represent precedence constraints is by using a directed graph G = (J, <) where J is the set of jobs. This graph is known as the precedence graph. Jobs are represented by vertices of the graph and precedence constraints are represented using directed edges. If there is a directed edge from Ji to Jj then it means that Ji is the immediate predecessor of Jj. For example: Consider a task T having 5 jobs J1, J2, J3, J4, and J5 such that J2 and J5 cannot begin their execution until J1 completes and there are no other constraints. 

The precedence constraints for this example are: 
J1 < J2 and J1 < J5  

Precedence graph

Set representation of precedence graph: 

  1. < (1) = { }
  2. < (2) = {1}
  3. < (3) = { }
  4. < (4) = { }
  5. < (5) = {1}

Consider another example where a precedence graph is given and you have to find precedence constraints 

precedence graph another example

From the above graph, we derive the following precedence constraints:  

  1. J1 < J2
  2. J2 < J3
  3. J2 < J4
  4. J3 < J4

FAQ:

What are some common examples of real-time systems?
Industries like aviation, healthcare, manufacturing, and telecommunications make use of real-time systems. The employed systems incorporate flight control applications, real-time monitors in healthcare facilities, industrial control systems, and real-time communication systems.

What is the difference between aperiodic and sporadic tasks?
Tasks that are aperiodic are not released on a regular schedule, whereas sporadic tasks are released at irregular but anticipated intervals. Aperiodic tasks may have lenient or nonexistent deadlines, while sporadic tasks are required to meet strict deadlines.

What is jitter in real-time systems?
The time release or execution of a task can be affected by a fluctuation known as Jitter. This phenomenon can be triggered by multiple factors including network delays, software errors, or hardware limitations. Struggling to manage Jitter can have a tremendous effect on real-time systems, so precise timing control is crucial.

How are precedence constraints represented in real-time systems?
Precedence constraints are represented using a directed graph called a precedence graph. Each job is represented by a vertex, and the precedence constraints are represented by directed edges between vertices. If there is a directed edge from job A to job B, it means that A must complete before B can begin.

What is the hyper period of a set of periodic tasks?
The hyper period of a set of periodic tasks is the least common multiple of their periods. It is the smallest time after which the pattern of job release times for all tasks in the set repeats. The hyper period is an important parameter in real-time scheduling, as it determines the scheduling cycle for the tasks.



Similar Reads

Real Time Systems
A real-time system means that the system is subjected to real-time, i.e., the response should be guaranteed within a specified timing constraint or the system should meet the specified deadline. For example flight control systems, real-time monitors, etc. Types of real-time systems based on timing constraints:Hard real-time system: This type of sys
4 min read
Time difference between expected time and given time
Given the initial clock time h1:m1 and the present clock time h2:m2, denoting hour and minutes in 24-hours clock format. The present clock time h2:m2 may or may not be correct. Also given a variable K which denotes the number of hours passed. The task is to calculate the delay in seconds i.e. time difference between expected time and given time. Ex
5 min read
Project Idea | C.A.R.T (CROWD ANALYTIC in REAL TIME)
Project Title: CART(CROWD ANALYTICS in REAL TIME) INTRODUCTION: They say “Relevant, actionable data is your ace of spades”. But to play that card, one needs to first have it in their deck. If any organization wants to make decisions based on facts, having actionable data on-hand empowers you to answer any “why?” questions. It’s 2018 and if there is
4 min read
What is Real-time Auction?| Mechanics, Applications, Benefits and Challenges
What is Real-Time Auction?The real-time auction can be defined as a progressive way of selling products or services, conceding spaces for advertisements, as well as purchasing goods or services online with an immediate result of bids and deals. Real-time auctions are not like normal auctions that can last for days or even for months as the completi
9 min read
Types of OLAP Systems in DBMS
OLAP is considered (Online Analytical Processing) which is a type of software that helps in analyzing information from multiple databases at a particular time. OLAP is simply a multidimensional data model and also applies querying to it. Types of OLAP ServersRelational OLAPMulti-Dimensional OLAPHybrid OLAPTransparent OLAPRelational OLAP (ROLAP): St
6 min read
Need and Functions of Operating Systems
The fundamental goal of an Operating System is to execute user programs and to make tasks easier. Various application programs along with hardware systems are used to perform this work. Operating System is software that manages and controls the entire set of resources and effectively utilizes every part of a computer. The figure shows how OS acts a
9 min read
Tek Systems Interview Experience
There was an on-campus drive of Tek system in our college. Recruitment Process: (1)Quantitative + Technical Round:- In this round there were five sections in a total duration of 90 minutes: Around 10 aptitude questions, 5 picture representation puzzles, 5 verbal, 5 technical and 1 coding question. Aptitude questions were of medium difficulty, Pictu
4 min read
Execution from RAM in Embedded systems
Prerequisite : Random Access Memory (RAM), Introduction of Embedded Systems Introduction :Unlike application programs in computers, software in embedded systems do not execute from RAM. In vast majority of modern embedded system architectures, programs (instructions) are stored in microcontroller’s flash memory (code flash/ program flash) and direc
6 min read
NICE Systems Ltd. Interview Experience | Set 4 (On-Campus)
Company Profile: It is an analytics product company. Global talent Center (GTC) only in Pune in India. works in customer centre analytics (you can call it as customer care call recording and analytics), fraud detection, totally works in agile, Israel based company. Round 1: (150+ students have appeared for this round.) APTITUDE TEST CONTAINS TOTAL
3 min read
Ittiam Systems Interview Experience | Set 2 (On-Campus)
Round 1- Ittiam systems conducted an online coding contest on Hackerearth. Top 30 students were called for further interviews. Round 2- This was a technical round held over Skype. They started off with some puzzles followed by some technical questions. Question 1 (Puzzle) - A and B are playing a game with a biased coin having probability of getting
2 min read
Find time when hour and minute hands superimpose
This puzzle is an extension of the famous interview problem, find angle between hour and minute hand at any given time. The questions asks us to find the time when they both superimpose. The hour hand moves 360o in 12 hours and thus, 0.5 degrees in 1 min. The minute hands moves 360 degrees in 60 min, hence, 6 degrees in 1 minute. After H hours and
1 min read
Useful and time saving bash commands in Linux
There are many useful bash scripts that can make things easier. Many things can be done just using the terminal. Here is a list of some of such useful bash scripts through which we can do things that cannot be done manually. 1. Counting the number of files(or directory) in a given directory: Go to the directory in which you want to count the number
3 min read
Find speed of man from speed of stream and ratio of time with up and down streams
Program to find the speed of man in km/hr, given the speed of stream in km/hr. Assume that the man takes n times (where n &gt; 1) as long to row upstream as to row downstream the river.Examples: Input : 5.5 4 Output : speed of man is 9.16667 km/hr Input : 4 3 Output : speed of man is 8 km/hr Approach Used :Let speed of the man in still water = x km
4 min read
Calculate speed, distance and time
When an object moves in a straight line at a steady speed, we can calculate its speed if we know how far it travels and how long it takes. This equation shows the relationship between speed, distance travelled and time taken: Speed is distance divided by the time taken. For example, a car travels 30 kilometres in 2 hours. Its speed is 30 ÷ 2 = 15km
6 min read
Time when minute hand and hour hand coincide
Given time in hours, find the time in minutes at which the minute hand and hour hand coincide in the next one hour. Examples: Input : 3 Output : (180/11) minutesInput :7 Output : (420/11) minutes Approach : 1. Take two variables for hour "h1 and h2" and then find the angle "theta" [theta = (30 * h1)] and then divide it by "11" to find the time in m
4 min read
Microsoft Full Time Interview (On Campus)
1st Round (75 mins) Online coding round hosted on CoCubes: Round of to nearest 10s multiple. If units digit of the given number 10 26==&gt;30 Print the next smallest palindrome number for a given number. E.g 51==&gt;55 66==&gt;77 99==&gt;101 Delete n nodes after traveling m nodes in a linked list until the end of the list 2nd Round (Group Fly) 30 m
3 min read
Puzzle | Best time to escape
Once there was a king. The king wanted to protect his kingdom from the outside world. So he made a rule that neither any citizen of the kingdom can go to the outer world nor anyone from outside can enter his kingdom. There was a common bridge between the kingdom and the outside world. The guard was assigned on the gates of the kingdom which was lin
1 min read
Problem on Time Speed and Distance
Question 1: A racing car covers a certain distance at a speed of 320 km/hr in 5 hours. To cover the same distance in 5/3 hours it must travel at a speed of: Solution: Given Distance is constant. So, Speed is inversely proportional to time. Ratio of time 5 : 5/3 Ratio of time becomes 3 : 1 Then, Ratio of speed 1 : 3 1 unit -&gt; 320 km/hr 3 unit -
6 min read
Case-specific sorting of Strings in O(n) time and O(1) space
Given a string str consisting of uppercase and lowercase characters. The task is to sort uppercase and lowercase characters separately such that if the ith place in the original string had an uppercase character then it should not have a lowercase character after being sorted and vice versa.Examples: Input: str = "gEeksfOrgEEkS" Output: eEfggkEkrEO
8 min read
How is the time complexity of Sieve of Eratosthenes is n*log(log(n))?
Pre-requisite: Sieve of Eratosthenes What is Sieve of Eratosthenes algorithm? In order to analyze it, let's take a number n and the task is to print the prime numbers less than n. Therefore, by definition of Sieve of Eratosthenes, for every prime number, it has to check the multiples of the prime and mark it as composite. This process continues unt
3 min read
Time of Flight (ToF) Sensors
Every few years, smartphone manufacturers push a select few features in their advertising campaigns – whether it is processing power, aesthetics, or, more commonly these days, cameras. Although cameras have been heavily promoted for several years now, I have noticed that they have become more and more specific. For example, in the past, the focus u
2 min read
How An Online Judge Works And How To Avoid Time Limit Exceeded Problem?
In this article, you will get consent on how an online judge works and this article discusses very frustrating error Time Limit Exceed error that coders get at some point in time while solving the questions at online platforms. The article primarily discusses three things: How does an online judge work?Why do we get TLE?How to avoid TLE?How Does An
4 min read
Signal Processing and Time Series (Data Analysis)
Signal processing is a field of engineering that focuses on analyzing analog and digital signals with respect to time. Time Series Analysis is one of the categories of signal processing. A time series is a sequence of data points recorded at regular intervals of time. Time series analysis is an important step before you develop a forecast of the se
6 min read
Minimum time required to visit all the special nodes of a Tree
Given an undirected tree consisting of N vertices where some of the nodes are special nodes, the task is to visit all the special nodes from the root node in minimum time. Time for traveling from one node to another node can be assumed as unit time. A node is special if the path from the root to the node consists of distinct value nodes. Example: I
14 min read
Lamport One Time Signature Scheme
Lamport One Time Signature is a method for constructing a digital signature and typically involved the use of a cryptographic hash function. As it is a one-time signature scheme, it can only be used to securely sign one message. Suppose Alice wants to digitally sign her message to Bob, the process can be explained in 3 steps: Key GenerationSignatur
3 min read
Jeel Vaishnav - Geek on the Top | “Our greatest glory is not in never failing, but in rising every time we fail”.
Geek on the top is all about success stories of Geeks who are working hard to chase their goals and are the inspiration for other geeks. Jeel Vaishnav is pursuing his graduation in Computer Science with Nirma University. He is a competitive programmer and works as a summer analyst in Goldman Sachs. He likes to share his knowledge of data structures
7 min read
While loop with Compile time constants
While loop is a control flow statement that allows code to be executed repeatedly based on a given Boolean condition. The while loop can be thought of as a repeating if statement. It is mostly used in situations where the exact number of iterations beforehand. Below is the image to illustrate the while loop: Syntax: while(test_expression){ // state
6 min read
Minimum time to burn a Tree starting from a Leaf node
Given a binary tree and a leaf node from this tree. It is known that in 1s all nodes connected to a given node (left child, right child, and parent) get burned in 1 second. Then all the nodes which are connected through one intermediate get burned in 2 seconds, and so on. The task is to find the minimum time required to burn the complete binary tre
15+ min read
Maximum time required for all patients to get infected
Given a matrix arr[][], consisting of only 0, 1, and 2, that represents an empty ward, an uninfected patient, and an infected patient respectively. In one unit of time, an infected person at index (i, j) can infect an uninfected person adjacent to it i.e., at index (i - 1, j), (i + 1, j), (i, j - 1), and (i, j + 1). The task is to find the minimum
15+ min read
Time Complexity of a Loop when Loop variable “Expands or Shrinks” exponentially
For such cases, time complexity of the loop is O(log(log(n))).The following cases analyse different aspects of the problem. Case 1 : for (int i = 2; i &lt;=n; i = pow(i, k)) { // some O(1) expressions or statements } In this case, i takes values 2, 2k, (2k)k = 2k2, (2k2)k = 2k3, ..., 2klogk(log(n)). The last term must be less than or equal to n, an
1 min read
Article Tags :
Practice Tags :