Method and system for synchronizing the execution of a critical code section
    3.
    发明申请
    Method and system for synchronizing the execution of a critical code section 审中-公开
    用于同步执行关键代码段的方法和系统

    公开(公告)号:US20100011372A1

    公开(公告)日:2010-01-14

    申请号:US12314608

    申请日:2008-12-12

    申请人: Guido Trensch

    发明人: Guido Trensch

    IPC分类号: G06F9/46

    CPC分类号: G06F9/526

    摘要: The invention concerns a method for synchronizing the execution of at least one critical code section (C1) by at least one of a plurality of concurrent tasks (S1, Sn) of an application (4), the application (4) running on an operating system (5) providing cooperative multitasking, the critical code section (C1) being restricted to execution by only a limited number of the plurality of tasks (S1, Sn), the method comprising at least the following steps performed by at least one of the tasks (S1, Sn): a. testing (F11) at least one variable (Mx) associated to the at least one critical code section (C1) and setting (F12) the variable (Mx) and entering the associated critical code section (C1), if the variable (Mx) is not set by another task (S1, Sn), or, waiting (F13) for a release (F22) by another task (S1, Sn) and releasing the CPU, if the variable (Mx) is already set by another task (S1, Sn); and b. resetting (F21) the variable (Mx) and releasing (F22) at least one of the other waiting tasks (S1, Sn) when leaving the critical code section (C1); c. wherein step a. is performed as an atomic function (F1).

    摘要翻译: 本发明涉及一种用于通过应用程序(4)的多个并发任务(S1,Sn)中的至少一个来同步至少一个关键代码段(C1)的执行的方法,所述应用程序(4)在运行中运行 系统(5)提供协同多任务,所述关键代码段(C1)仅被限制数量的所述多个任务(S1,Sn)限制,所述方法至少包括以下步骤中的至少一个执行: 任务(S1,Sn):a。 与所述至少一个关键代码段(C1)相关联的至少一个变量(Mx)和所述变量(Mx)的设置(F12)并进入相关联的关键代码段(C1)的测试(F11),如果所述变量(Mx) 如果变量(Mx)已被另一个任务设置(M1),则不被另一任务(S1,Sn)设置,或者由另一任务(S1,Sn)等待(F13)释放(F22)并释放CPU, S1,Sn); 和b。 当离开关键代码段(C1)时,复位(F21)变量(Mx)和释放(F22)至少一个其他等待任务(S1,Sn); C。 其中步骤a。 作为原子函数(F1)进行。