0
2.2kviews
What is a task and the various states in which the task can be in an embedded environment
1 Answer
1
39views

Task refers to something that needs to be done. It is an independent sequence of instruction that can compete with concurrent task for CPU execution time. Various states of tasks are:

i) Created State: (Idle)

The task is created here and memory is allotted to structure. It is not ready yet and is not scheduled by the Kernel.

ii) Ready (Active) State:

The created task is ready and scheduled by Kernel. It is not running at present as another high priority task is scheduled to run. The task is waiting for the processor execution time in this state. It is placed in ‘Ready list’ queue.

iii) Running State:

In this state the source code instruction corresponding to the process is being executed. It will run till it needs some input or starts wait or till it is pre-empted by another higher priority task.

iv) Blocked (Waiting) State:

The running process is temporarily suspended from execution and does not have immediate access to resource. Block state might be invoked -

  • When process enters a wait state for an event to occur
  • While waiting for getting access to shared resource

v) Completed (Finish) State:

In this state the process completes its execution. The created task has memory de-allotted to its structure. The memory is freed in this state.

Process States

Please log in to add an answer.