Task Management
F5-6(1)
The Dormant state corresponds to a task that resides in memory but has not
been made available to μC/OS-III.
A task is made available to μC/OS-III by calling a function to create the task,
OSTaskCreate() . The task code actually resides in code space but μC/OS-III
needs to be informed about it.
When it is no longer necessary for μC/OS-III to manage a task, call the task
delete function, OSTaskDel() . OSTaskDel() does not actually delete the code
of the task, it is simply not eligible to access the CPU.
F5-6(2)
The Ready state corresponds to a ready-to-run task, but is not the most
important task ready. There can be any number of tasks ready and μC/OS-III
keeps track of all ready tasks in a ready list (discussed later). This list is
sorted by priority.
F5-6(3)
The most important ready-to-run task is placed in the Running state. On a
single CPU, only one task can be running at any given time.
The task selected to run on the CPU is switched in by μC/OS-III from the ready
state when the application code calls OSStart() , or when μC/OS-III calls
either OSIntExit() or OS_TASK_SW() .
As previously discussed, tasks must wait for an event to occur. A task waits for
an event by calling one of the functions that brings the task to the pending
state if the event has not occurred.
F5-6(4)
Tasks in the Pending state are placed in a special list called a pend-list (or wait
list) associated with the event the task is waiting for. When waiting for the
event to occur, the task does not consume CPU time. When the event occurs,
the task is placed back into the ready list and μC/OS-III decides whether the
newly readied task is the most important ready-to-run task. If this is the case,
the currently running task will be preempted (placed back in the ready list) and
the newly readied task is given control of the CPU. In other words, the newly
readied task will run immediately if it is the most important task.
93
相关PDF资料
AD-UCUSBD-SPRD PRD LIC UCUSB DEV CORE CCES SGL
AD637-EVALZ BOARD EVALUATION FOR AD637
AD736-EVALZ BOARD EVALUATION FOR AD736
AD737-EVALZ BOARD EVALUATION FOR AD737
AD8007AKS-EBZ BOARD EVAL FOR AD8007AKS
AD8018ARU-EVAL BOARD EVAL FOR AD8018
AD8034ART-EBZ BOARD EVAL FOR AD8034ART
AD8040AR-EBZ BOARD EVAL FOR AD8040AR
相关代理商/技术参数
ADUCOSC100 制造商:Analog Devices 功能描述:ADC - Rail/Tube
ADUCOSC100-REEL 功能描述:DAC MICROCONVERTER DUAL TSSOP 制造商:analog devices inc. 系列:* 零件状态:上次购买时间 标准包装:1
ADUCOSC100-REEL7 功能描述:DAC MICROCONVERTER DUAL TSSOP 制造商:analog devices inc. 系列:* 零件状态:上次购买时间 标准包装:1
ADUCOSCZ100 制造商:Analog Devices 功能描述:
ADUCOSCZ100-REEL7 制造商:Analog Devices 功能描述:ANAADUCOSCZ100-REEL7 12 BIT ADC WITH EMB
ADuC-P7026 功能描述:开发板和工具包 - ARM PROTOTYPE BRD FOR ADUC7026 ARM7 RoHS:否 制造商:Arduino 产品:Development Boards 工具用于评估:ATSAM3X8EA-AU 核心:ARM Cortex M3 接口类型:DAC, ICSP, JTAG, UART, USB 工作电源电压:3.3 V
ADUCRF101 制造商:Analog Devices 功能描述:PRECISION ANALOG MICRCONTROLLER - Tape and Reel
ADUCRF101BCPZ128 制造商:Analog Devices 功能描述:PRECISION ANALOG MICROCONTROLLER WITH RF TRANSCEIVER, ARM CO - Trays