5.1
Introduction
Task Basics
Task Control
Error Status
System Tasks
5-1
What is Real-Time?
5-2
Deterministic operation:
A late answer is a wrong answer.
5-3
Design Options
5-4
Unitasking Approach
5-5
Multitasking Approach
5-6
Task States
5-7
Multitasking Kernel
FPU
5-8
Kernel Operation
5-9
Context Switch
5-10
5-11
Priority Scheduling
5-12
5-13
Round-Robin Scheduling
5-14
Slicing Time
kernelTimeSlice(ticks)
If ticks = 0, time slicing is turned off.
5-15
Performance Enhancements
5-16
Multitasking Facilities
5-17
Deterministic operation
Preemptive priority scheduling assures response for high priority
tasks.
5-18
Real-Time Multitasking
Introduction
5.2
Task Basics
Task Control
Error Status
System Tasks
5-19
Overview
5-20
Creating a Task
5-21
Creating a Task
int taskSpawn (name, priority, options,
stackSize, entryPt, arg1, , arg10)
name
priority
options
stackSize
entryPt
5-22
Task IDs
5-23
Task Names
taskNameToId( )
5-24
Task Priorities
5-25
Task Stacks
5-26
Stack Overflows
5-27
Task Options
VX_NO_STACK_FILL
VX_UNBREAKABLE
Disable breakpoints.
VX_DEALLOC_STACK
Deallocate stack and TCB when task exits
(automatically set for you).
5-28
Task Creation
5-29
Task Deletion
taskDelete (tid)
exit(code)
5-30
Resource Reclamation
5-31
Real-Time Multitasking
Introduction
Task Basics
5.3
Task Control
Error Status
System Tasks
5-32
Task Restart
taskRestart (tid)
5-33
Task Suspend/Resume
taskSuspend (tid)
taskResume (tid)
Removes suspension.
5-34
Task Delay
5-35
Possible Solutions:
Use only stack variables in applications.
Protect the resource with a semaphore.
Use task variables to make the variable private to a task.
5-36
Task Hooks
5-37
Task Information
ti (taskNameOrId)
5-38
Task Browser
To obtain information
about a specific task,
double-click on the tasks
summary line in the main
task browser display, or
enter the tasks ID in the
Show box.
5-39
What is POSIX?
5-40
5-41
Real-Time Multitasking
Introduction
Task Basics
Task Control
5.4
Error Status
System Tasks
5-42
Error Status
5-43
5-44
Setting Errno
5-45
Examining Errno
5-46
Interpreting Errno
15
module
error number
5-47
Error Messages
5-48
5-49
Real-Time Multitasking
Introduction
Task Basics
Task Control
Error Status
5.5
System Tasks
5-50
System Tasks
Task Name
Priority
Function
tUsrRoot
tLogTask
Message logging.
tExcTask
tWdbTask
tNetTask
50
tFtpdTask
55
FTP server.
5-51
Summary
5-52
Summary
Task information
ti/show
Task Browser
5-53