ESD (TASKS AND STATES)
Tasks in embedded system
- a task is a process or thread in an operating system.
- an application program is also said to be a program consisting of tasks.
- Task: it is the term used in the RTOS in the embedded system.
- runs when it is scheduled by the OS.
- task request or sends or recieves messages through OS functions.
- task is that executional unit of computation which is controllled by (i) OS process scheduling mechanism--->which executes on CPU. (ii) OS process resource management mechanism that lets it use the system memory, files, network, printer.
- Task is an independent process.
- No Task can call another Task. Task can send messages that lets another Task run.
- The OS can block a running Task and let another task gain the access CPU to run the service code.
- Task user keypad input
- Task read amount
- chocolate delivery Task
- Display Task
- GUI Task
- Communication task
- Idle state(unattached or not registered).
- Ready state( registered or attached).
- Running state.
- Blocked (waiting state) state.
- Delayed for the preset period.
IDLE (CREATED)state:
- Task has been created and memory is allocated to it. however it is not ready and not scheduled by the OS(kernal).
- The created task is ready and is scheduled by the kernal but not running at present as another high priority task is scheduled to run and get system resources at this instant.
- Executing the codes and getting the system resources at this instance. It will run till it needs some IPC (input) or wait for an event or till it gets preempted by another higher priority task than this one.
- Execution of task codes suspends after saving the needed parameters into its context.
- It needs some IPC (input) or it needs to wait for an event or wait for higher priority task to block to enable running after blocking.
- A task is pending while it waits for an input from the keyboard or a file. The scheduler then puts it in the blocked state
- The created task has memory deallotted to its structure. It frees the memory. Task has to be re-created
Comments
Post a Comment