[SOLVED] operating system CSCI 3150 Introduction to Operating Systems Assignment Two

$25

File Name: operating_system_CSCI_3150_Introduction_to_Operating_Systems_Assignment_Two.zip
File Size: 706.5 KB

5/5 - (1 vote)

CSCI 3150 Introduction to Operating Systems Assignment Two
Deadline: 23:55, Oct. 27, 2019
Total Marks: 100
1. 100 marks
Implement the MLFQ (Multi-Level Feedback Queue) scheduler in Chapter 8 (Book: Operating Systems: Three Easy Pieces) by following the rules below:
Rule 1: If Priority(A) > Priority(B), A runs (B doesnt).
Rule 2: If Priority(A) = Priority(B), A & B run in round-robin fashion using the time
slice (quantum length) of the given queue. In this case, let the pids of A and B be pid_A
and pid_B respectively, then A will be scheduled first if pid_A < pid_B. Rule 3: When a job enters the system, it is placed at the highest priority (the topmostqueue). Rule 4: Once a job uses up its time allotment at a given level (regardless of how manytimes it has given up the CPU), its priority is reduced (i.e., it moves down one queue). Rule 5: After some time period S, move all the jobs in the system to the topmost queue.In this question, we assume the time unit is millisecond (ms). Please note that in this assignment, we have different time allotment for different queue.The inputs of your program: process.file and queue.cfg process.file contains the process information and its format is as follows:Here, the first line denotes there are N processes to be scheduled (there is at least one space character between ProcessNum and N), and from the second line to the (N+1)th line, each shows the pid (process id), arrival time and execution time of a process with the format like pid:X1, arrival_time:X11, execution_time:X12 (separated by ,). To make it simple, you can assume that all pids are different. An example is given below. ProcessNum Npid:X1, arrival_time:X11, execution_time:X12 pid:X2, arrival_time:X21, execution_time:X22 …pid:XN, arrival_time:XN1, execution_time:XN2 ProcessNum 4pidnum:123, arrival_time:50, execution_time:90 pidnum:13, arrival_time:80, execution_time:220 pidnum:1023, arrival_time:10, execution_time:1660 pidnum:12, arrival_time:80, execution_time:8 queue.cfg contains the queue information and its format is as follows:Here, the first line denotes the number of queues we will use in the scheduler, the second line denotes the period S to move up all jobs to the topmost queue (Rule 5), the third line denotes the time slice for Queue n that is the topmost queue with the highest priority (the smallest time slice), and the subsequent lines define other queues with descending order in terms of priority. In each line, between the keyword and number, there should be at least one space character. One example is shown below. QueueNum nPeriod_S STime_Slice_QN Xn Allotmenttime_QN Yn …Time_Slice_Q2 X2 Allotmenttime_Q2 Y2 Time_Slice_Q1 X1 Allotmenttime_Q1 Y1 QueueNum 6Period_S 500Time_Slice_Q6 10 Allotmenttime_Q6 20 Time_Slice_Q5 20 Allotmenttime_Q5 40 Time_Slice_Q4 30 Allotmenttime_Q4 60 Time_Slice_Q3 40 Allotmenttime_Q3 80 Time_Slice_Q2 50 Allotmenttime_Q2 100 Time_Slice_Q1 60 Allotmenttime_Q1 120The output of your program: output.log Your program should output the schedule to the file, output.log The format in output.log is as follows (This is very important as we will check the output based on this format):Time_slot:x-y, pid:x1, arrival-time:x2, remaining_time:x3Here, Time_slot:x-y denotes the time interval starting at time x and end at time y (Commonly the time interval is the time slice of current queue. If one process finishes without using the whole time slice, the time interval will be the time it used, and the smallest time interval is 1 ms.), pid:x1 denotes the corresponding process with pid x1 is scheduled in this time interval, arrival-time:x2 and remaining_time:x3 denote the arrival time and remaining time of the process are x2 and x3, respectively. There is at least one space character between them. An example is shown below: Time_slot:10-20, pid:1023, arrival-time:10, remaining_time:1650 Time_slot:20-30, pid:1023, arrival-time:10, remaining_time:1640 Time_slot:30-50, pid:1023, arrival-time:10, remaining_time:1620 Time_slot:50-60, pid:123, arrival-time:50, remaining_time:80 Time_slot:60-70, pid:123, arrival-time:50, remaining_time:70 Time_slot:70-90, pid:123, arrival-time:50, remaining_time:50 Time_slot:90-98, pid:12, arrival-time:80, remaining_time:0 Time_slot:98-108, pid:13, arrival-time:80, remaining_time:210Submission:In this Assignment, you need to revise functionvoid scheduler(Process* proc, LinkedQueue** ProcessQueue, int proc_num, int queue_num, int period);to implement the MLFQ (Multi-Level Feedback Queue) scheduler.You only need to submit scheduler-impl.c that will be compiled with the same Makefile.

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[SOLVED] operating system CSCI 3150 Introduction to Operating Systems Assignment Two
$25