الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

ارجو المساعدة Job / CPU Scheduling

مغلق
بدأه عابدة الرحمن في 5 مايو 2006 · 0 رد · 859 مشاهدة · في هندسة البرمجيات
مشاركة: واتساب X فيسبوك تيليجرام
#1

 Design & Implement a program that simulates the Shortest Job First (SJF) CPU scheduling of an operating system, assuming that all the jobs will arrive at the same time. Your program must calculate the following:

1. Average Waiting Time (AWT)

2. Average Response Time (ART)

3. Average Turnaround Time (ATT)

 Example: SJF (non-preemptive)

Processes CPU Burst

P1 6 ms

P2 8 ms

P3 7 ms

P4 3 ms

 Waiting Time: Amount of time spent ready to run but not running.

 Response Time: Time between submission of requests and first response to the request.

 Turnaround Time: mean time from submission to completion of process.

 The Structure PCB must include the following items:

struct PCB

{

int pid; //Process ID ,Generated Randomly (100-500)

int cpu_time; //CPU Burst ,Generated Randomly (10-50)

int a_time; //Arrival Time is equal in all PCB's

int w_time; //Waiting Time ,Calculated

int r_time; //Response Time ,Calculated

int t_time; //Turnaround Time ,Calculated

int job_no; //Job Number 1,2,3,…………..,N

char status; //Ready State "R"

int PC; //Program Counter, Generated Randomly (111-999)

char Flag; //Interrupt Flag "E" or "D"

struct PCB *nextptr; //Pointer to next Node

};

 The input to your program is the number of jobs to schedule within an interactive screen; your program must be able to repeat this operation depending on user request (Y, N).

 The output must display the PCB contents before and after scheduling in a table form.

 Include comments in your source code.

هذا الموضوع مغلق.

مواضيع مشابهة