Skip to main content

PyTorch Code for Simple Neural Networks for MNIST Dataset

Introduction to Real Time Systems

System
Set of one or more inputs entering the black box and a set of outputs exiting the black box is called a system.

Response Time
The time between the presentation of set of inputs and the appearance of the associated outputs.

Real time System
A System that must satisfy the response tine constraints or it will be a failure.

Embedded System
A software system that is completely encapsulated by the hardware that it controls.

Deadline
The instant of time at which the execution of task is required to be completed.
* absolute deadline
* relative deadline = absolute deadline – release time

Release time
The instant of time at which the task or job is ready for execution

Challenges or Issues in Real time Systems
  • Selection of hardware and Software (Hardware includes sensors, actuators, timers, controllers or processors)
  • Selection of the operating Systems (Real Time Operating System) (RTOS works under the preemption principle.)
  • Selection of Programming language. (C, C++, ADA, Java, etc)
  • Maximizing the fault tolerance
  • Testing of the systems
  • Prediction and measurement of response time (The system should predict and measure of the response time before the development of the application.)
  • Concurrent control
Temporal parameters of Real Time workload
Task – A set of related jobs that execute to support a function is called a task.
Periodic task
Aperiodic task
Sporadic task
Fixed, Jittered and sporadic release time
Jittered means the range of release time
(ri- , ri+) the release time is given range
Execution time
Depends on the complexity of job and speed of the processor
The MPEG compression will take long time to execute.

Functional Parameters of RTS
  • Preemption of jobs
  1. if one job is running, when the other job comes and want of the execution, the first job is suspended and then the second job will be executed, after the second job complete, the first again resumes. This is called preemption. Usually the RTOS are working under the preemptive scheduling mechanism.
  2. The disadvantage here is the overhead due to the context switching. Because switching between the tasks frequently is a over head.
  • Criticality of jobs
  1. Criticality means the urgency of a job. That is, if a job is a urgent job so that it should be completed soon, then the job is said to be critical and that job has to be given higher priority or weightage.
  2. Generally, if tasks are there, then we can say priority of the task and if jobs are there, then we can say weightage of the job.
  • Optional execution
  1. Some jobs may be partially done or not at all executed, we can simple neglect those jobs or in other words the jobs are optional one.
  • Laxity type
  1. Determines whether hard or soft deadlines
  2. Based on usefulness function
Scheduling Hierarchies
A scheduler is responsible for managing the resource allocation to the tasks and it is based on the scheduling algorithms. A scheduler produces a valid schedules should obey these rules
  • Every process is assigned to atmost one job at a time
  • Every job is assigned to atmost one processor at a time
  • No job is scheduled before its release time
  • Depending on the scheduling algorithms used, the total amount of processor time assigned to every job is equal to its actual execution time
  • All the precedence and resource usage constraints are satisfied.

Precedence constraints and data dependency
  • Precedence graph and task graph
  1. Ti <>
  2. Tj is constrained to be preceded by Ti
  • Data dependency
  1. A common pool of data is used by various tasks in the system. So it is said as the shared data, being the data shared, there may not be any precedence constraints.
  • Temporal dependency
  1. Jobs are said to have a temporal distance constraint if their temporal distance must be a finite value. For example, the synchronizing the video and audio should have a temporal distance of 160ms.
  • * AND/ OR precedence constraints
  1. One job will be waiting for all its immediate predecessor to be completed before its execution begins.
  2. Eg. Transmitting a message can be accomplished only after the following three conditions, so transmitting a message refers a AND job.
  3. Setting the connection
  4. Encrypt the data
  5. Checking users account

  • One or more of its immediate predecessors are completed, and then it starts its execution. This is called as OR precedence constraints.
  1. So, to draw the task graph one should note these things in mind
  2. AND job is represented by - unfilled circle - o
  3. OR job is represented by – square box
  4. Branching is by means of – filled circle
Examples
o o o o o -(each circle indicate one task) there are five tasks, all are independent and
one task does not depend on the other. So, No precedence constraints

o------->o------> o------->o------> o------> o Here there are five tasks with precedence
constraints and one task after the completion, then only the next task will run, this is a dependency relationship

Comments

  1. The specified time constraint... its response time and deadline associated with the Operating System..... Windows XP, the response time is unpredictable..

    ReplyDelete
  2. sir,
    is RTOS an hardware specific ?
    or its like some kernel will be available for development ?

    ReplyDelete
  3. sir,
    is RTOS an hardware specific ?
    or its like some kernel will be available for development ?

    ReplyDelete

Post a Comment

Popular posts from this blog

Installing ns3 in Ubuntu 22.04 | Complete Instructions

In this post, we are going to see how to install ns-3.36.1 in Ubuntu 22.04. You can follow the video for complete details Tools used in this simulation: NS3 version ns-3.36.1  OS Used: Ubuntu 22.04 LTS Installation of NS3 (ns-3.36.1) There are some changes in the ns3 installation procedure and the dependencies. So open a terminal and issue the following commands Step 1:  Prerequisites $ sudo apt update In the following packages, all the required dependencies are taken care and you can install all these packages for the complete use of ns3. $ sudo apt install g++ python3 python3-dev pkg-config sqlite3 cmake python3-setuptools git qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools gir1.2-goocanvas-2.0 python3-gi python3-gi-cairo python3-pygraphviz gir1.2-gtk-3.0 ipython3 openmpi-bin openmpi-common openmpi-doc libopenmpi-dev autoconf cvs bzr unrar gsl-bin libgsl-dev libgslcblas0 wireshark tcpdump sqlite sqlite3 libsqlite3-dev  libxml2 libxml2-dev libc6-dev libc6-dev-i386 libclang-dev llvm-

Installation of NS2 (ns-2.35) in Ubuntu 20.04

Installation of NS2 (ns-2.35) in Ubuntu 20.04 LTS Step 1: Install the basic libraries like      $] sudo apt install build-essential autoconf automake libxmu-dev Step 2: install gcc-4.8 and g++-4.8 open the file using sudo mode $] sudo nano /etc/apt/sources.list Include the following line deb http://in.archive.ubuntu.com/ubuntu bionic main universe $] sudo apt update $] sudo apt install gcc-4.8 g++-4.8 Step 3:  Unzip the ns2 packages to home folder $] tar zxvf ns-allinone-2.35.tar.gz $] cd ns-allinone-2.35/ns-2.35 Modify the following make files. ~ns-2.35/Makefile.in Change @CC@ to gcc-4.8 change @CXX@ to g++-4.8 ~nam-1.15/Makefile.in ~xgraph-12.2/Makefile.in ~otcl-1.14/Makefile.in Change in all places  @CC@ to gcc-4.8 @CPP@ or @CXX@ to g++-4.8 open the file: ~ns-2.35/linkstate/ls.h Change at the Line no 137  void eraseAll() { erase(baseMap::begin(), baseMap::end()); } to This void eraseAll() { this->erase(baseMap::begin(), baseMap::end()); } All changes made Step 4: Open a new termi

Installation of NS2 in Ubuntu 22.04 | NS2 Tutorial 2

NS-2.35 installation in Ubuntu 22.04 This post shows how to install ns-2.35 in Ubuntu 22.04 Operating System Since ns-2.35 is too old, it needs the following packages gcc-4.8 g++-4.8 gawk and some more libraries Follow the video for more instructions So, here are the steps to install this software: To download and extract the ns2 software Download the software from the following link http://sourceforge.net/projects/nsnam/files/allinone/ns-allinone-2.35/ns-allinone-2.35.tar.gz/download Extract it to home folder and in my case its /home/pradeepkumar (I recommend to install it under your home folder) $ tar zxvf ns-allinone-2.35.tar.gz or Right click over the file and click extract here and select the home folder. $ sudo apt update $ sudo apt install build-essential autoconf automake libxmu-dev gawk To install gcc-4.8 and g++-4.8 $ sudo gedit /etc/apt/sources.list make an entry in the above file deb http://in.archive.ubuntu.com/ubuntu/ bionic main universe $ sudo apt update Since, it&#