Tasks, Process and Threads

Sequential Execution of Instructions


  1. Each task is independent since it is controlled by a scheduler or kernel of an Operating System
  2. No task can call other tasks. since the Scheduler schedules the tasks
  3. Each task is associated with an ID.
  4. Each task has priority. for a 1 byte priority assignment, values 0 to 255 is used. higher the value higher the priority
  5. Each task should coded in such a way that, they are waiting for a endless – event waiting loop.
  6. Each task has a Task Control Block (TCB)
  7. Each task will be having its own context and values at an instant. it is having its own Program counter(PC) and stack pointer (SP.
  8. Each task will be in any one of the following 4 states
  • idle – After the completion of one cycle of execution, a task will be in idle state until an event is fired
  • ready – the task is ready to execute on the CPU, but the CPU is busy with executing higher priority tasks
  • Running – currently the task is executing on the CPU – only one task can be in this state at any point of time
  • Blocked or waiting – the task is waiting for an event to execute


  1. Each task or process contains light weight process called threads. Each process or tasks more than one thread.
  2. Tasks are kernel controlled entity where the threads are task controlled entity
  3. Threads are sub process or sub tasks.
  4. Different threads of same task can share the common structure available for the tasks

Software Maintenance

There are five types of software maintenance

  1. Preventive Maintenance – A system may be checked and maintained periodically
  2. Corrective Maintenance – Correct the deviation noticed under certain conditions of field use of the system
  3. Perfection or Enhancement Maintenance – development team delivers a system on schedule and then finds another design capable of working more accurately and effectively
  4. Adaptive Maintenance – Adapt the software to new conditions
  5. System Reengineering – previously developed system is reengineered.

Software Project Management

People Senior Manager
1. Responsible for creating environment,
2. Organising, coordinating and managing all communications

Project Technical Manager or Team Leader
1. Selecting the language and tools
2. reorganize available software specification
3. Maintain activity graph for starting
4. motivates and encourage implementors

1. Implements the software and hardware development process
2. uses modeling, source code engineering, testing

Customer or End User
1. Specifies the product and its quality requirements

Embedded System product

1. Product Development partitioned into smaller components and modules so that activities defined in the graph for activity are finished

1. Design
2. Planning
3. Implementing and testing
4. Debugging and Maintaining

Sine Wave Generation

#include reg51.h>
at 0x2000 xdata char sinetable[13];
at 0x80 sfr sineout;
char dacout;
char i;
void timer_isr(void) interrupt 1
dacout = sinetable[i++];
TH0= 0xff;
dacout = sinetable[0];
void main()
sinetable [0] = 128; //0
sinetable [1] =192; //30
sinetable [2] =238; //60
sinetable [3] =255; //90
sinetable [4] =238;
sinetable [5] =192;
sinetable [6] =128;
sinetable [7] =64;
sinetable [8] =17;
sinetable [9] =0;
sinetable [10] =17;
sinetable [11] =64;
sinetable [12] =128;
TCON = 0x01;
TH0 = 0xff;
TL0 = 0xFb;
dacout = sinetable [i++];
for (;;);

Issues in Real Time Software Development

Issues in Requirement Analysis and Design

  • Inter Process Communication
  • Fault Tolerance and Reliability
  • Event Latencies
  • Maximum Latencies of ISRs
  • Maximum response Time

Issues in Implementation

  • Selection of OS (RTOS)
  • Selection of Processors, Hardware, Memory and its Size
  • Selection of Programming Language
  • Power Management using wait and sleep mode
  • Caches to be used or not

Issues in Testing

  • Testing the Inter Process Communication (IPC)
  • Testing Parallelism and Concurrency
  • Testing Memory and Stack Overflow
  • Testing Software Portability in Hardware
  • Testing Software Hardware Integration
  • Testing the program flow in critical regions for shared data
  • Testing the throughput from the tasks and ISRs