ARM Technical Support Knowledge Articles

SETTING ROUND-ROBIN TIMESHARING TO 1

Applies to: RTX51 Tiny Real-time Kernel

Answer


Information in this article applies to:


SYMPTOMS

In CONF_TNY.A51, you may specify a value for the number of ticks each task runs in round-robin multitasking.

;
;               ; define Round-Robin Timeout in Hardware-Timer Ticks.
TIMESHARING     EQU     5       ; default is 5 ticks.
;               ;
;               ; note: Round-Robin can be disabled by using value 0.
;
;  Note:   Round-Robin Task Switching can be disabled by using '0' as
;          value for the TIMESHARING equate.

Any value other than 0 enables round-robin multitasking. However, setting TIMESHARING to a value of 1 causes problems with the real-time kernel. This value should be avoided.

CAUSE

When the value for TIMESHARING is 1, a race condition may occur when creating tasks. If a new task is created just before the next timer tick interrupt occurs, you may get a round robin time-out for the newly created and activated task. However, in this case no round-robin time switch occurs and the task runs until the next time out. This means that this task will run for 256 RTX timer ticks.

The same problem might appear when a task switch occurs due to an os_wait call in another task.

RESOLUTION

Don't set TIMESHARING to 1 for round-robin multitasking.

MORE INFORMATION

Article last edited on: 2005-07-17 11:10:30

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential