5.5.12 · D1 · HinglishEmbedded Systems & Real-Time Software

FoundationsReal-time constraints — hard and soft deadlines

2,168 words10 min read↑ Read in English

5.5.12 · D1 · Coding › Embedded Systems & Real-Time Software › Real-time constraints — hard and soft deadlines

Yeh Real-time constraints — hard and soft deadlines ka "toolbox unpack karo" wala page hai. Parent note tumhare saamnay bahut saare letters phenkta hai — , , , , , , , , . Yahan hum har ek ko, order mein, earn karte hain, pehle se kisi formula mein use hone se pehle.


Step 0 — "Task" aur "job" kya hota hai?

Kisi bhi symbol se pehle, humein woh cheez chahiye jo symbols describe karti hai.

Ek factory worker (task) ki picture socho jo din mein kaafi baar wahi kaam karta hai (har kaam ek job hai). Hum tasks ko subscript se label karte hain: task 1, task 2, task 3 — likha jata hai . Subscript sirf ek name tag hai taaki hum "-wey task" ke baare mein baat kar sakein bina har ek ki picture banaaye.


Step 1 — Timeline: cheezein kab hoti hain

Real-time ki har cheez ek single horizontal time axis par rehti hai, seconds daayein taraf badhte hain. Ek job ke liye teen moments matter karte hain.

Figure — Real-time constraints — hard and soft deadlines

Teen alag ideas kyun? Kyunki "kaam kab arrive karta hai", "kab due hai", aur "actually kitna time laga" genuinely alag questions hain, aur deadline teeno ko relate karta hua ek statement hai.

Relative vs absolute deadline

Parent likhta hai . Ise algebra ki jagah picture ki tarah padho:


Step 2 — Kaam kitna time leta hai? WCET

Ek job ko finish karne ke liye kuch CPU time chahiye. Lekin woh amount run to run vary karti hai — cache miss, longer input, branch lena — toh ek akela number kaam nahi karega. Humein choose karna hoga ki kaun sa number.

Figure — Real-time constraints — hard and soft deadlines

Note karo ek duration hai (seconds of CPU), bilkul aur ki tarah. In teeno "seconds" quantities ko straight rakhna aadhi battle hai.


Step 3 — Repeating work: period

Bahut saare real-time tasks periodic hote hain — yeh har fixed interval mein ek fresh job release karte hain. Yeh spacing period hai.

Figure — Real-time constraints — hard and soft deadlines

Periodic tasks aur event-triggered ones ke beech ka difference Periodic vs Aperiodic Tasks mein cover kiya gaya hai. Abhi ke liye picture hold karo: ek metronome jo har seconds mein tick karta hai, aur har tick par tak length ki ek job appear hoti hai.


Step 4 — CPU ka share: utilisation aur

Ab hum woh money question pooch sakte hain: ek task processor ka kitna hissa khaata hai?

length ke ek period mein, task ko (worst case) seconds of CPU chahiye. Us period ka woh fraction jo task par spend hota hai:

Figure — Real-time constraints — hard and soft deadlines

Ratio kyun? Kyunki "2 ms of work" ka koi matlab nahi jab tak pata na ho yeh kitni baar repeat hoti hai. 2 ms har 10 ms mein light hai; 2 ms har 3 ms mein heavy hai. Ratio ongoing demand capture karta hai, jo exactly wahi hai jo shared CPU ko care karna chahiye.

Summation symbol

Kai tasks combine karne ke liye hum unke shares add karte hain. Parent likhta hai , jahan Step 0 se task count hai.


Step 5 — Ceiling symbol

Parent ka exact test use karta hai. Woh funny bracket aakhri symbol hai jo unlock karna hai.

Poori preemption count logic RTOS scheduler design aur Rate-Monotonic Scheduling mein belong karti hai; yahan humein sirf symbol padhna tha.


Foundations topic ko kaise feed karte hain

task and job

timeline r d R

task count n

deadline test R le D

WCET C worst case

utilisation U = C over T

period T

sum symbol

total U = sum of C over T

hard soft firm deadlines

schedulability tests

ceiling symbol

Real-time constraints topic

Top to bottom padhna: raw ideas (task, WCET, period, symbols) combine hokar deadline test aur utilisation sum banate hain, jo saath milkar deadlines ki classification aur schedulability proofs ko power karte hain jo parent note build karta hai.


Equipment checklist

Daayein side cover karo aur reveal se pehle jawab do.

Ek job vs ek task
Task repeated work hai; job uski ek single run hai (tasks kai jobs emit karte hain).
Task count
CPU share karne wale tasks ki total number; index , se tak chalta hai.
Release time
Woh clock moment jab job run hone ke liye ready ho jaati hai.
Relative deadline
Ek stopwatch length — release ke baad job finish karne ke liye kitne seconds milte hain ().
Absolute deadline
Exact clock moment jab woh due hai; .
Response time
Release se actual finish tak ka duration (; ek arrow length, moment nahi).
Deadline meet karne ki condition
— response stopwatch ke andar fit ho jaata hai.
WCET
Worst-Case Execution Time — sabse zyada CPU time jo job ko kabhi lag sakta hai ().
WCET kyun average nahi
Deadlines unlucky longest run par break hoti hain, toh guarantees maximum use karti hain.
Period
Ek periodic task ki successive releases ke beech ka fixed gap ().
Utilisation
— woh fraction of CPU jo ek task demand karta hai ( chahiye).
ka matlab
Saare tasks mein se tak add karo; sigma shorthand hai "inhe sum karo" ke liye.
Total utilisation
; agar toh CPU over-subscribed hai.
Ceiling
ko next whole number tak round up karna.
Preemptions ke liye ceiling kyun
Tum fractional number of times interrupt nahi ho sakte; har hit safely count karne ke liye upar round karo.