5.5.12 · HinglishEmbedded Systems & Real-Time Software

Real-time constraints — hard and soft deadlines

1,844 words8 min readRead in English

5.5.12 · Coding › Embedded Systems & Real-Time Software


Real-time system KYA hota hai?

Key quantity hai deadline: woh latest time jis tak task ka response complete hona chahiye, task ke release (arrival) time se measure karke.


Deadlines classify kyun karein? Hard vs Soft vs Firm

Miss hua deadline ki cost application se application bahut alag hoti hai. Hum classify karte hain utility ke basis pe — ek result jo apni deadline ke baad deliver ho, uski utility kya hai.

Figure — Real-time constraints — hard and soft deadlines

Hard deadline KAISE guarantee karein?

Aap "test karte raho jab tak fast laage" wali approach nahi le sakte. Hard real-time ko ek provable bound chahiye. Recipe yeh hai:

  1. Har task ke liye WCET determine karo (static analysis ya measured worst case).
  2. Ek scheduling policy chuno (e.g. fixed-priority Rate-Monotonic, ya EDF).
  3. Ek schedulability test chalao: ek mathematical proof ki worst-case load mein sabhi deadlines meet hongi.

Sabse simple test derive karna: CPU utilisation bound


Soft deadlines: ek alag goal

Soft real-time ke liye aap zero misses prove nahi karte — aap statistics bound karte ho: jaise "99.9% frames 16 ms mein render honge," ya average tardiness minimize karo. Design knob hai graceful degradation: crash karne ki jagah quality drop karo, frames skip karo, ya load shed karo.


Flashcards

Ek system ko "real-time" kya banata hai?
Correctness dono pe depend karta hai — logical result aur woh time jab woh produce hota hai (timeliness correctness ka hissa hai).
Hard deadline — miss hone ka consequence?
Catastrophic / total system failure; late result invalid hai.
Firm deadline — miss hone ka consequence?
Late result ki zero value hoti hai aur discard ho jaata hai, lekin koi catastrophe nahi.
Soft deadline — miss hone ka consequence?
Result ki reduced/degrading value rehti hai; kabhi-kabhi misses tolerate hoti hain.
WCET kya hai aur ise (average ki jagah) kyun use karein?
Worst-Case Execution Time; deadlines worst case mein fail hoti hain, isliye guarantees maximum pe build honi chahiye, na ki mean pe.
Ek periodic task ki utilisation?
(CPU fraction jo woh demand karta hai).
tasks ki total utilisation?
; agar toh CPU over-subscribed hai aur miss unavoidable hai.
Liu–Layland RM schedulability bound?
; limit jab .
Ek CPU pe EDF utilisation bound?
(EDF periodic single-processor ke liye optimal hai).
Kya RM utilisation test sufficient hai ya necessary?
Sirf Sufficient — ise fail karna unschedulability prove nahi karta; exact Response-Time Analysis use karo.
Response-Time Analysis equation?
, convergence tak iterate karo; schedulable iff .
kyun aata hai?
Yeh count karta hai ki higher-priority task , task ko ke during kitni baar preempt karta hai.
Hard real-time goal ek word mein?
Predictability (bounded worst case), raw speed nahi.
Recall Feynman: 12-saal ke bachche ko explain karo

Socho school bus pakadna. Hard deadline: ek second bhi late ho toh bus chali jaati hai aur school miss — disaster. Firm deadline: aap aa toh sakte ho, lekin late aaye toh homework "count nahi hoga" — koi points nahi, lekin kisi ko hurt nahi; bas throw away karo. Soft deadline: thoda late aana allowed hai aur phir bhi zyaadatar marks milenge, bas jitna late, utne kam. Yeh promise karne ke liye ki hard bus kabhi miss nahi hogi, aap "main fast bhaagunga" nahi kehte — aap slowest chalak speed measure karte ho, ek door use karne wale sabhi logon ko jodते ho, aur prove karte ho ki aap sab time pe fit ho jaate ho. Fast-on-average koi promise nahi hai; worst case use karke proof hai.

Connections

Concept Map

correctness needs

central quantity

d_i = r_i + D_i

meets if R_i <= D_i

worst-case bound

classified by lateness cost

classified by lateness cost

classified by lateness cost

miss = catastrophe

late = zero value, discard

late = degrading value

needs

feeds

sum over tasks

Real-time system

Timeliness

Deadline d_i

Release time r_i

Response time R_i

WCET C_i

Hard deadline

Firm deadline

Soft deadline

Provable guarantee

Schedulability test

Utilisation U_i = C_i / T_i