Книга: Real-Time Concepts for Embedded Systems
16.2 Resource Classification
16.2 Resource Classification
In embedded systems, resources are shared among various concurrently executing tasks. Examples of these shared resources include I/O devices, machine registers, and memory regions. These shared resources are categorized as either preemptible or nonpreemptible .
A preemptible resource can be involuntarily and temporarily removed from a task without affecting the task's execution state or result. The machine registers set that is shared among multiple tasks is an example. When kernel scheduling preempts a current task, the content of the machine registers, including the execution state of the current task, is saved into main memory. The registers are reinitialized to execute another task. When that other task completes, the execution state is restored to the register set, and the preempted task is resumed. The scheduler guarantees that the register set contains the execution state from a single task even though the registers are shared among multiple tasks throughout the system's lifetime.
A non-preemptible shared resource must be voluntarily relinquished by the owning task, or unpredictable results can occur. A shared memory region belongs to this category. For example, one task should not be allowed to write to a shared memory region before another task completes its read or write operation.
The types of resources a task holds are important when deciding on what solutions to take when the task is involved in deadlock situations. Section 16.3.3 discusses the relationship between the resource types and deadlock recovery mechanisms in detail.
- Appendix E. Other resources and links
- 15.4 Resource Synchronization Methods
- Assessing Your Backup Needs and Resources
- Web Resources
- Printing Resource Usage with top
- APPENDIX B Installation Resources
- APPENDIX C Fedora and Linux Internet Resources
- Appendix E. Open Source Resources
- Thread resources on the Internet
- Other resources
- Auditing system resources
- Using, configuring, and managing Resource Manager disk quotas