Critical region accessing method and device

2016 
The invention discloses a critical region accessing method and device. According to the scheme, CPU ID information is added in the information area of a mutex lock, and the CPU ID indicates that the tasks running on a CPU corresponding to CPU ID lock the mutex lock. When the tasks access the critical region, first whether the mutex lock in the information area is in the locked state or not is detected; if yes, the CPU ID stored in the information area of the mutex lock is read; if the read CPU ID is the same as the CPU ID of the self located CPU, a dormant state is entered. Then the tasks in the same CPU can enter the dormant state directly, and do not need to conduct polling, so that the polling times is reduced, and the purpose of saving processing resources is achieved.
    • Correction
    • Source
    • Cite
    • Save
    • Machine Reading By IdeaReader
    0
    References
    0
    Citations
    NaN
    KQI
    []