![]() ![]() ![]() I’m new in programming and wondering if you have programmed for similar cases. Then I would assign the first job with earlier arrival time to one of its suitable machines ĭo the same to the second coming, the third and more. ![]() So in my case, firstly I would make a list of jobs based on their arrival time (1 job – 1 machine (this machine should be from MAC). ![]() The constraints in my case is that for each job, it has its own several specific machines MAC to be assignment to. The difference of my case with yours is that I cannot assignment all jobs to a single machine. Now I need to get a machine-job match based on FCFS. I know about the arrival time of each job, i know how long each job would be finished (all machines have the same speed). However, in my case, I have several servers (let’s say I have 10 machines) and 100 processes (jobs). Like in your example, 3 process would be processed in sequence by one server. Im trying to program for FCFS.Īll related examples online I found are for 1 server (machine) N processes (job). Simulation completed for FCFS (see results in table below). Waiting time is accumulated while a process waits in the ready queue. After completing an I/O event, a process is transferred to the ready queue.Ĥ. Assume that no process waits on I/O devices.ģ. TurnaroundTime = burstTime waitTime Ĭonsole.WriteLine("P" "\t\t" burstTime "\t\t" "\t\t" waitTime "\t\t" turnaroundTime) Ĭonsole.WriteLine("Average Waiting Time is :" avgWaitTime) Ĭonsole.WriteLine("Average TurnaroundTime is:" avgTurnAroundTime) Ģ. NoOfProcess = Convert.ToInt32(Console.ReadLine()) Ĭonsole.WriteLine(” Enter Process burst time “) īurstTime = Convert.ToInt32(Console.ReadLine()) Ĭonsole.WriteLine(" Process Burst Time in Sequence ") Ĭonsole.WriteLine("P" "=" burstTime) Ĭonsole.WriteLine("Process" "\t\t" "Burst Time" "\t\t" "Waiting Time" "\t\t" "Turn Around Time") Printf("The average waiting time is %lf and average turn around time is %lf",aw_time/n,atat_time/n) Ĭonsole.WriteLine(“Enter Total Process “) Printf("Enter the arrival time and burst time : ") Printf(“Enter the number of process : “) Int pid, a_time, b_time, c_time, w_time, tat_time Wap to implement the first come first serve algorithm in operating system. The whole program is wrong : the correct implementation would be ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |