• OSEK OS Resource management


    qThe resource management is used to co-ordinate concurrent accesses of several tasks with different priorities to shared resources

    ve.g.management entities (scheduler), program sequences, memory or hardware areas.

    vThe resource management can optionally be extended to co-ordinate concurrent accesses of tasks and interrupt service routines.

    qResource management ensures that

    vtwo tasks cannot occupy the same resource at the same time.

    vpriority inversion cannot occur.

    vdeadlocks do not occur by use of these resources.

    vaccess to resources never results in a waiting state.

    qIf the user requires protection against interruptions not only caused by tasks, but also caused by interrupts, he/she can also use the operating system services to enable/disable interrupts which do not cause rescheduling.

    qRestrictions when using resources

    vTerminateTask,ChainTask,Schedule,WaitEvent shall not be called while a resource is occupied.

    vInterrupt service routine shall not be completed with a resource occupied.

    qScheduler as a resource

    vIf a task shall protect itself against preemptions by other tasks, it can lock the scheduler.

    vThe scheduler is treated like a resource which is accessible to all tasks.

     优先级反转(低优先级的任务T4占有信号量S1,导致最高优先级的任务T1不能使用S1而进入等待状态,而此时比T1优先级低的任务T2,T3得以运行)

     死锁(任务T1占用信号量S1,等待S2;任务T2占用信号量S2,等待S1

    qOSEK Priority Ceiling Protocol(优先级天花板协议优先级最高协议)

    vTo avoid the problems of priority inversion and deadlocks:

    §At the system generation, to each resource its own ceiling priority is statically assigned.

     üThe ceiling priority shall be set at least to the highest priority of all tasks that access a resource or any of the resources linked to this resource.

    üThe ceiling priority shall be lower than the lowest priority of all tasks that do not access the resource, and which have priorities higher than the highest priority of all tasks that access the resource.

    §If a task requires a resource, and its current priority is lower than the ceiling priority of the resource, the priority of the task is raised to the ceiling priority of the resource.

    §If the task releases the resource, the priority of this task is reset to the priority which was dynamically assigned before requiring that resource.

     

     

    qInternal Resources

    vInternal resources are resources which are not visible to the user and therefore can not be addressed by the system functions GetResource and ReleaseResource.

    §managed strictly internally within a clearly defined set of system functions.

    §the behaviour of internal resources is exactly the same as standard resources (priority ceiling protocol etc.).

    vInternal resources are restricted to tasks.

     §Atmost one internal resource can be assigned to a task during system generation. vIf an internal resource is assigned to a task, the internal resource is managed asfollows:

    §The resource is automatically taken when the task entersthe running state,except when it has already taken the resource.

    üAs a result, the priority of the task is automatically changed to the ceiling priority of the resource.

    §At the points of rescheduling, the resource is automatically released.

     vInternal resources can be used in all cases when it is necessary to avoid not-wanted rescheduling within a group of tasks.


  • 相关阅读:
    我们的路该如何走?-序言
    [转贴]给想立志入行网络或已经初入行的朋友的建议(三)
    [转贴]给想立志入行网络或已经初入行的朋友的建议(二)
    为应用程序池defaultAppPool提供服务的进程在于world wide web publishing服务通信时遇到致命错误 进程id为1356. 数据字段包含错误号
    this.get_element .style为空或不是对象
    将linq查询转换为DataTable对象——学习笔记
    ASP.NET 未被授权访问所请求的资源。请考虑授予 ASP.NET 请求标识访问此资源的权限。
    常用改变选中行颜色
    DataTable写入Excel中 用Excel标准格式
    导出Excel出错:检索 COM 类工厂中 CLSID 为 {0002450000000000C000000000000046} 的组件失败
  • 原文地址:https://www.cnblogs.com/iable/p/4206845.html
Copyright © 2020-2023  润新知