Tasks, Process and Threads

Process
Sequential Execution of Instructions

Tasks
  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
Threads
  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

Comments

Popular Posts