Changeset dc2b337 in rtems for doc/user/task.t
- Timestamp:
- 11/16/99 18:28:20 (23 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- 71689d44
- Parents:
- 1dbf307
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/user/task.t
r1dbf307 rdc2b337 32 32 @item @code{@value{DIRPREFIX}task_wake_after} - Wake up after interval 33 33 @item @code{@value{DIRPREFIX}task_wake_when} - Wake up when specified 34 @item @code{@value{DIRPREFIX}task_variable_add} - Associate per task variable 35 @item @code{@value{DIRPREFIX}task_variable_delete} - Remove per task variable 34 36 @end itemize 35 37 … … 286 288 task attempting to access the floating point unit is CPU dependent but will 287 289 generally result in an exception condition. 290 291 @subsection Per Task Variables 292 293 @cindex per task variables 294 295 Per task variables are used to support global variables whose value 296 may be unique to a task. After indicating that a variable should be 297 treated as private or pre-task. The task can access and modify the 298 variable, but the modifications will not appear to other tasks, and 299 other tasks' modifications to that variable will not affect the value 300 seen by the task. This is accomplished by saving and restoring the 301 variable's value each time a task switch occurs to or from the calling task. 302 303 This feature can be used when a routine is to be spawned repeatedly as 304 several independent tasks. Although each task will have its own stack, 305 and thus separate stack variables, they will all share the same static and 306 global variables. To make a variable not shareable (i.e. a "global" variable 307 that is specific to a single task), the tasks can call 308 @code{rtems_task_variable_add} to make a separate copy of the variable 309 for each task, but all at the same physical address. 310 311 Task variables increase the context switch time to and from the 312 tasks that own them so it is desirable to minimize the number of 313 task variables. One efficient method is to have a single task 314 variable that is a pointer to a dynamically allocated structure 315 containing the task's private "global" data. 316 317 A critical point with per-task variables is that each task must separately 318 request that the same global variable is per-task private. 288 319 289 320 @subsection Building a Task Attribute Set … … 1545 1576 1546 1577 A clock tick is required to support the functionality of this directive. 1578 1579 @page 1580 1581 @subsection TASK_VARIABLE_ADD - Associate per task variable 1582 1583 @cindex per-task variable 1584 @cindex task private variable 1585 @cindex task private data 1586 1587 @subheading CALLING SEQUENCE: 1588 1589 @ifset is-C 1590 @findex rtems_task_variable_add 1591 @example 1592 rtems_status_code rtems_task_variable_add( 1593 rtems_id tid, 1594 int *ptr 1595 ); 1596 @end example 1597 @end ifset 1598 1599 @ifset is-Ada 1600 @example 1601 procedure Task_Variable_Add ( 1602 Id : in RTEMS.ID; 1603 Ptr : in RTEMS.Address; 1604 Result : out RTEMS.Status_Codes 1605 ); 1606 @end example 1607 @end ifset 1608 1609 @subheading DIRECTIVE STATUS CODES: 1610 @code{@value{RPREFIX}SUCCESSFUL} - per task variable added successfully@* 1611 @code{@value{RPREFIX}INVALID_ID} - invalid task id@* 1612 @code{@value{RPREFIX}NO_MEMORY} - invalid task id@* 1613 @code{@value{RPREFIX}ILLEGAL_ON_REMOTE_OBJECT} - not supported on remote tasks 1614 @code{@value{RPREFIX}NOT_DEFINED} - system date and time is not set 1615 1616 @subheading DESCRIPTION: 1617 This directive adds the memory location specified by the 1618 ptr argument to the context of the given task. The variable will 1619 then be private to the task. The task can access and modify the 1620 variable, but the modifications will not appear to other tasks, and 1621 other tasks' modifications to that variable will not affect the value 1622 seen by the task. This is accomplished by saving and restoring the 1623 variable's value each time a task switch occurs to or from the calling task. 1624 1625 @subheading NOTES: 1626 1627 Task variables increase the context switch time to and from the 1628 tasks that own them so it is desirable to minimize the number of 1629 task variables. One efficient method 1630 is to have a single task variable that is a pointer to a dynamically 1631 allocated structure containing the task's private `global' data. 1632 1633 @page 1634 1635 @subsection TASK_VARIABLE_DELETE - Remove per task variable 1636 1637 @cindex per-task variable 1638 @cindex task private variable 1639 @cindex task private data 1640 1641 @subheading CALLING SEQUENCE: 1642 1643 @ifset is-C 1644 @findex rtems_task_variable_delete 1645 @example 1646 rtems_status_code rtems_task_variable_delete( 1647 rtems_id tid, 1648 int *ptr 1649 ); 1650 @end example 1651 @end ifset 1652 1653 @ifset is-Ada 1654 @example 1655 procedure Task_Variable_Delete ( 1656 Id : in RTEMS.ID; 1657 Ptr : in RTEMS.Address; 1658 Result : out RTEMS.Status_Codes 1659 ); 1660 @end example 1661 @end ifset 1662 1663 @subheading DIRECTIVE STATUS CODES: 1664 @code{@value{RPREFIX}SUCCESSFUL} - per task variable added successfully@* 1665 @code{@value{RPREFIX}INVALID_ID} - invalid task id@* 1666 @code{@value{RPREFIX}NO_MEMORY} - invalid task id@* 1667 @code{@value{RPREFIX}ILLEGAL_ON_REMOTE_OBJECT} - not supported on remote tasks 1668 @code{@value{RPREFIX}NOT_DEFINED} - system date and time is not set 1669 1670 @subheading DESCRIPTION: 1671 This directive removes the given location from a task's context. 1672 1673 @subheading NOTES: 1674 1675 NONE 1676
Note: See TracChangeset
for help on using the changeset viewer.