uCOS专区

前后台系统,不可剥夺型内核和可剥夺型内核比较

发布日期:2011/11/27

Foreground/
Background

Non-Preemptive Kernel

Preemptive Kernel

Interrupt latency (Time)

MAX(Longest instruction,
    User int. disable)
+ Vector to ISR

MAX(Longest instruction,
    User int. disable, 
    Kernel int. disable)
+ Vector to ISR

MAX(Longest instruction, 
    User int. disable, 
    Kernel int. disable)
+ Vector to ISR

Interrupt response (Time)

Int. latency
+ Save CPU’s context

Int. latency
+ Save CPU’s context

Interrupt latency
+ Save CPU’s context
+ Kernel ISR entry function

Interrupt recovery (Time)

Restore background’s
    context
+ Return from int.

Restore task’s context
+ Return from int.

Find highest priority task
+ Restore highest priority
    task’s context
+ Return from interrupt

Task response (Time)

Background

Longest task
+ Find highest priority task
+ Context switch

Find highest priority task
+ Context switch