Книга: Real-Time Concepts for Embedded Systems
8.5.1 Condition Variable Control Blocks
8.5.1 Condition Variable Control Blocks
The kernel maintains a set of information associated with the condition variable when the variable is first created. As stated previously, tasks must block and wait when a condition variable's predicate evaluates to false. These waiting tasks are maintained in the task-waiting list. The kernel guarantees for each task that the combined operation of releasing the associated mutex and performing a block-wait on the condition will be atomic. After the desired conditions have been created, one of the waiting tasks is awakened and resumes execution. The criteria for selecting which task to awaken can be priority-based or FIFO-based, but it is kernel-defined. The kernel guarantees that the selected task is removed from the task-waiting list, reacquires the guarding mutex, and resumes its operation in one atomic operation. The essence of the condition variable is the atomicity of the unlock-and-wait and the resume-and-lock operations provided by the kernel. Figure 8.14 illustrates a condition variable control block.
Figure 8.14: Condition variable control block.
The cooperating tasks define which conditions apply to which shared resources. This information is not part of the condition variable because each task has a different predicate or condition for which the task looks. The condition is specific to the task. Chapter 15 presents a detailed example on the usage of the condition variable, which further illustrates this issue.
- 8.5.2 Typical Condition Variable Operations
- 15.7.1 Data Transfer with Flow Control
- Introduction to Microprocessors and Microcontrollers
- Using Double Quotes to Resolve Variables in Strings with Embedded Spaces
- Data sending and control session
- 1. TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
- Data Binding Using the GridView Control
- Configure Access Control
- Using the kill Command to Control Processes
- 3.4.4. Concurrency Control
- Access Variable Data Files in the
- Using Environment Variables