Critical Sections
Measuring the scheduler lock time adds measurement artifacts and thus increases the
amount of time the scheduler is actually locked. However, measurement overhead is
accounted for and the measured value represents the actual scheduler lock time as if the
measurement was not present.
4-3 μC/OS-III FEATURES WITH LONGER CRITICAL SECTIONS
Table 4-1 shows several μC/OS-III features that have potentially longer critical sections.
Knowledge of these will help the user decide whether to direct μC/OS-III to use one critical
section over another.
Feature
Multiple tasks at the same priority
Event Flags
Chapter 14, “Synchronization” on page 251
Pend on multiple objects
Chapter 16, “Pending On Multiple Objects” on
page 313
Broadcast on Post calls
See OSSemPost() and OSQPost() descriptions in
Appendix A, “μC/OS-III API Reference Manual” on
page 375.
Reason
Although this is an important feature of μC/OS-III, multiple
tasks at the same priority create longer critical sections.
However, if there are only a few tasks at the same priority,
interrupt latency would be relatively small.
If multiple tasks are not created at the same priority, use the
interrupt disable method.
If multiple tasks are waiting on different events, going through
all of the tasks waiting for events requires a fair amount of
processing time, which means longer critical sections.
If only a few tasks (approximately one to five) are waiting on
an event flag group, the critical section would be short
enough to use the interrupt disable method.
Pending on multiple objects is probably the most complex
feature provided by μC/OS-III, requiring interrupts to be
disabled for fairly long periods of time should the interrupt
disable method be selected. If pending on multiple objects, it
is highly recommended that the user select the
scheduler-lock method.
If the application does not use this feature, the interrupt
disable method is an alternative.
μC/OS-III disables interrupts while processing a post to
multiple tasks in a broadcast.
When not using the broadcast option, you can use the
interrupt disable method.
Table 4-1 Disabling interrupts or locking the Scheduler
73
相关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