Learning Corner
Java J2SE အတန်းသစ်မကြာခင်ဖွင့်ဖို့ရှိပါတယ်။
page messenger မှာစုံစမ်းနိုင်ပါတယ်။
2024 April FE exam မှာ Subject A Q_13 မှာမေးသွားတဲ့ priority scheduling algorithm အကြောင်းဆွေးနွေးပါမယ်။
================================
Q_13. An operating system adopts the priority scheduling algorithm for scheduling processes. There are five processes A, B, C, D and E arriving at the same time with estimated running times of 10, 6, 2, 4, and 8 milliseconds, respectively. Their priorities are 3, 5, 2, 1, and 4, where 1 is the highest priority. What is the mean process turnaround time?
a) 14 b) 16 c) 20 d) 22
ဒီလို Q မျိုးက ခဏခဏ မေးလေ့ရှိပါတယ်။ ပေးထားချက်တွေပြောင်းလိုက်တယ်။ scheduling algorithm တွေပြောင်းလိုက်တယ်။ မေးတဲ့ ဦးတည်ချက်ပြောင်းတယ်။ ဒီလိုပုံစံမျိုးစုံနဲ့မေးပါတယ်။ ဒီလိုမေးခွန်းမျိုးအတွက် OS ရဲ့ scheduling algorithms တွေကိုသေချာနားလည်သဘောပေါက်ထားဖို့လိုပါတယ်။
OS သည် job တွေအများကြီးဝင်လာတဲ့အခါမှာ critical place (CPU) လိုနေရာမျိုးကို တစ်ပြိုင်နက်တည်း ပေးသုံးလို့မရတဲ့အတွက် ဘယ် job ပြီးရင် ဘယ် job ဝင်ရမယ်ဆိုတဲ့ပုံစံမျိုး schedule ဆွဲပေးပါတယ်။ အဲ့လိုဆွဲပေးတဲ့နေရာမှာ preemptive Scheduling နဲ့ Non preemptive Scheduling ဆိုပြီး ၂ မျိုးရှိပါတယ်။
preemptive ဆိုတာကတော့ OS က job တွေကို force သုံးပြီး halt လုပ်ပြီးအခြား job ကိုအလှည့်ပေးတာမျိုးဖြစ်ပြီး Non preemptive ဆိုတာကတော့ OS က အဲ့ဒါမျိုး force နဲ့ job တွေကို halt လုပ်တာမျိုးမလုပ်တာဖြစ်ပါတယ်။
Preemptive scheduling algorithms တွေထဲမှာ priority scheduling, time slice (or) round robin scheduling တို့ပါဝင်ပြီး Non-preemptive ထဲမှာတော့ FIFO scheduling တို့ပါဝင်ပါတယ်။
Priority scheduling အလုပ်လုပ်ပုံကတော့ job တွေမှာ priority တွေပါလာမှာဖြစ်ပါတယ်။ highest priority ရှိတဲ့ job ကိုဦးစားပေးအနေနဲ့ execute လုပ်ခွင့်ပြုမှာဖြစ်ပါတယ်။ ဒါကြောင့် low priority ရှိတဲ့ job တွေဟာ waiting time တွေတက်လာဖို့ရှိနေပါတယ်။ နောက်တစ်ခုက high priority ရှိတဲ့ job တွေကဘဲ CPU လိုမျိုးကို occupied လုပ်နေတဲ့အတွက် တစ်ယောက်တည်း monopolize သုံးနေသလိုမျိုးလည်းဖြစ်သွားနိုင်ပါတယ်။ ဒါကြောင်း low priority ရှိတဲ့ job တွေဟာ age တွေဖြစ်လာပြီး starvation လိုမျိုးကိုဖြစ်ပေါ်စေနိုင်တဲ့အတွက် dynamic priority ကိုသုံးတာမျိုးလည်းရှိလာပါတယ်။ priority scheduling မှာ priority သတ်မှတ်ပုံကတော့ shortest processing time ရှိတဲ့ job ကို high priority ပေးခြင်းကိုသုံးပါတယ်။ ဒါမှသာ အခြား job တွေရဲ့ waiting time ကိုလျော့ချနိုင်မှာဖြစ်ပါတယ်။ ဒါကတော့ priority scheduling အကြောင်းပါ။
အပေါ်က Q မှာတော့ processes 5 ခု A,B,C,D,E ဆိုပြီး arrival time ကိုတူတူပေးထားပါတယ်။ arrival time တူတဲ့အတွက် တွက်ရတာကိုလွယ်သွားစေပါတယ်။ priority တွေကတော့အစဉ်တိုင်းမဟုတ်ပါဘူး။ average turnaround time ကိုမေးထားတာဖြစ်ပါတယ်။
Turnaround time = completion time - arrival time
ဒီမှာက arrival time တူနေတဲ့အတွက် turnaround time သည် completion time ဖြစ်သွားပါတယ်။ priority နဲ့ process တွေကိုစီလိုက်ရင်တော့
process priority running time (ms) Turnarround Time
D 1 4 ms 4 ms
C 2 2 ms 6ms (C သည် သူ့ထက် priority မြင့်တဲ့ D ပြီးအောင်စောင့်ရတဲ့အတွက် waiting time 4ms ထည့်ပေါင်းရေးရပါမယ်။)
A 3 10 ms 6+10 = 16 ms
E 4 8 ms 16+ 8 = 24 ms
B 5 6 ms 24 + 6 = 30 ms
Question က the mean process turnaround time ကိုမေးတဲ့အတွက်
(4+6+16+24+30)/5 = 16 ms
correct ans: (b) ဖြစ်ပါတယ်။
06/07/2026
ITPEC FE Class Online ပါ။
Subject A
Subject B သီးသန့်လည်းတက်လို့ရပါတယ်။
ITPEC FE Online Class
===============
October 25th, 2026, မှာ ဖြေရမယ့် ဂျပန်အပါအဝင် နိုင်ငံ ၇ နိင်ငံမှာအသိအမှတ်ပြု FE exam အတွက် (Subject A+ Subject B) online class ဖြစ်ပါတယ်။
Subject A+ Subject B တက်လို့ရသလို တချို့ Subject A အောင်ထားသူအတွက် Subject B သီးသန့်လည်းတက်လို့ရပါတယ်။
Subject B အတွက် programming အပိုင်းအတွက်ကို java နဲ့သင်မှာဖြစ်ပါတယ်။
Start Date: 2 July 2026
Subject A: Thursday, Friday (8PM to 10PM)
Subject B: Saturday, Sunday (7PM to 9PM)
Duration: (4) Months
Fee: Subject A (150000 Ks per month)
Subject B (150000 Ks per month)
Page messenger မှာ phone no နဲ့ email ပေးပြီး စာရင်းပေးလို့ရပါပြီ။
ဒီအပတ်မှာ ITPEC subject A ရော subject Bရောစပါပြီ။
သင်တန်းမတက်ဖြစ်တဲ့သူများအတွက်လည်း post နဲ့ lecture video တွေကို page မှာတင်ပေးသွားဖို့တော့ရှိပါတယ်။
The best Algorithm ကိုဘယ်လိုရွေးမလဲဆိုရင် problem, data နဲ့ constraints တွေမူတည်ပြီးရွေးရပါတယ်။ တစ်ခုတည်းကိုကြည့်ပြီးတော့ ဒါက the best algorithm ဖြစ်တယ်လို့ပြောလို့မရပါ။
Algorithm ရဲ့ goal ကဘာလဲ
performance (accuracy နဲ့ speed) ကဘယ်လိုရှိလဲ
computational cost နဲ့ interpretability မှာ trade-off ရှိရဲ့လားဆိုတာတွေကို analyze လုပ်ဖို့လိုပါတယ်။
Time and Space Complexity တွေနဲ့တိုင်းတာပြီးပြောတယ်ဆိုပေမယ့် specific problem ပေါ်မှာလည်းမူတည်ပါတယ်။
Click here to claim your Sponsored Listing.
Category
Telephone
Website
Address
Yangon