Question about Home

1 Answer

Design and implement a program that simulates the Shortest Job First (SJF) CPU scheduling algorithm. Assume that all processes will arrive at the same time. The PCB Structure must include the following items: struct PCB { int pid; //Process ID ,Generated Randomly int cpu_time; //CPU Burst ,Generated Randomly int w_time; //Waiting Time ,Calculated int job_no; //Job Number, Sequence 1,2,3,? char status[10]; //Ready, Runnble or Complete struct PCB *nextptr; //Pointer to next Node };  The input to your program is the number of processes to schedule within an interactive screen. Your program must be able to repeat this operation depending on user request (Y, N).  Find the average waiting time and total execution time of your program in s. A sample output to be displayed on the screen is the following: Enter no. of processes to be scheduled: 6 List of Processes: job_no pid cpu_time status 1 1091 3 Ready 2 7569 8 Ready 3 1127 7 Ready 4 3572 11 Ready 5 1361 4 Ready 6 1442 2 Ready The SJF Scheduled Queue: job_no pid cpu_time w_time status 6 1442 2 0 Runnable 1 1091 3 2 Ready 5 1361 4 5 Ready 3 1127 7 9 Ready 2 7569 8 16 Ready 4 3572 11 24 Ready Starting Process Execution: Executing process 1442 for 2 s job_no pid cpu_time w_time status 6 1442 2 0 Complete 1 1091 3 0 Runnable 5 1361 4 3 Ready 3 1127 7 7 Ready 2 7569 8 14 Ready 4 3572 11 22 Ready A sample output to be displayed on the screen is the following: Enter no. of processes to be scheduled: 6 List of Processes: job_no pid cpu_time status 1 1091 3 Ready 2 7569 8 Ready 3 1127 7 Ready 4 3572 11 Ready 5 1361 4 Ready 6 1442 2 Ready The SJF Scheduled Queue: job_no pid cpu_time w_time status 6 1442 2 0 Runnable 1 1091 3 2 Ready 5 1361 4 5 Ready 3 1127 7 9 Ready 2 7569 8 16 Ready 4 3572 11 24 Ready Starting Process Execution: Executing process 1442 for 2 s job_no pid cpu_time w_time status 6 1442 2 0 Complete 1 1091 3 0 Runnable 5 1361 4 3 Ready 3 1127 7 7 Ready 2 7569 8 14 Ready 4 3572 11 22 Ready

Posted by on

  • nawara53 May 12, 2010

    No, in java or c

  • nawara53 May 12, 2010

    Can you please answer me before 2morrow midnight please.

    It's argent ....



    Thank you..



×

Ad

1 Answer

  • Level 3:

    An expert who has achieved level 3 by getting 1000 points

    All-Star:

    An expert that got 10 achievements.

    MVP:

    An expert that got 5 achievements.

    Vice President:

    An expert whose answer got voted for 100 times.

  • Master
  • 787 Answers

You need it in ASM?

Posted on May 03, 2010

Ad

1 Suggested Answer

6ya6ya
  • 2 Answers

SOURCE: I have freestanding Series 8 dishwasher. Lately during the filling cycle water hammer is occurring. How can this be resolved

Hi,
a 6ya expert can help you resolve that issue over the phone in a minute or two.
Best thing about this new service is that you are never placed on hold and get to talk to real repairmen in the US.
the service is completely free and covers almost anything you can think of.(from cars to computers, handyman, and even drones)
click here to download the app (for users in the US for now) and get all the help you need.
Goodluck!

Posted on Jan 02, 2017

Ad

Add Your Answer

Uploading: 0%

my-video-file.mp4

Complete. Click "Add" to insert your video. Add

×

Loading...
Loading...

Related Questions:

1 Answer

Our teacher gave us a project about cpu scheduling, we need to create an application or program about the topic. The problem is he never discussed about cpu scheduling. I tried many research and read about...


Firstly this may be a bit over my head, but, i will try to help u.
CPU scheduling, is all about what the the CPU's priority's are .( Or tasks that come first.) Have you tried a block diagram. ie. a bit like a pyramid Ok got as far as MLQF then done a search on internet.
Well done good one..

Apr 12, 2011 | Televison & Video

1 Answer

I need to write a program in c implementing the merklehellman knapsack algorithm.please help me


Find a document describing the algorithm.
Find a textbook that teaches how to program in the C language.
Ask your teacher for additional assistance.

Mar 03, 2011 | Computers & Internet

1 Answer

Question 1: Find out the reasons those have made the UNIX an amazingly successful operating system. What are the Features on existing UNIX based operating systems like Linux Red Hat, Fedora and Ubantu...


Question 4: Consider the following set of processes that arrive in the ready queue at the same time:

Process CPU time

P1 2

P2 1

P3 4

P4 3

P5 1

P6 2



Consider the following scheduling algorithms: FCFS, SJF and Round Robin (quantum = 1)

(i) What is turnaround time of each process for each of the above

scheduling algorithms?

(ii) What is the waiting time of each process for each of the above

algorithms?

Jan 06, 2011 | Televison & Video

1 Answer

Cpu scheduling algorithems using vb


Nice try. Do your own homework, or get an upper-class student to give you one-on-one tutoring.

Nov 28, 2009 | Microsoft Visual Basic .NET Standard 2003...

1 Answer

System scheduling


Nice try. Find an upper-class student to give you one-on-one tutoring to help you with your homework assignment.

Oct 06, 2009 | Microsoft Windows XP Professional

2 Answers

CPU Scheduling VB.Net Sample Program


well threading does this for you, look at the thread class and related classess in .net

Jun 02, 2009 | Microsoft Visual Basic .NET Standard 2003...

2 Answers

I need a program of cpu scheduling using C++ please help me out it consit of FCFS,SJF and RR..


// crt_clock.c // This example prompts for how long // the program is to run and then continuously // displays the elapsed time for that period. // #include <stdio.h> #include <stdlib.h> #include <time.h> void sleep( clock_t wait ); int main( void ) { long i = 6000000L; clock_t start, finish; double duration; // Delay for a specified time. printf( "Delay for three seconds\n" ); sleep( (clock_t)3 * CLOCKS_PER_SEC ); printf( "Done!\n" ); // Measure the duration of an event. printf( "Time to do %ld empty loops is ", i ); start = clock(); while( i-- ) ; finish = clock(); duration = (double)(finish - start) / CLOCKS_PER_SEC; printf( "%2.1f seconds\n", duration ); } // Pauses for a specified number of milliseconds. void sleep( clock_t wait ) { clock_t goal; goal = wait + clock(); while( goal > clock() ) ; }

Mar 22, 2009 | Computers & Internet

1 Answer

Simulate the Shortest Job First CPU scheduling algorithm


Nice try! Find an upper-class student to give you one-on-one tutoring for your homework.

Jan 14, 2009 | Computers & Internet

1 Answer

Data mining


Hello, you can find the best open-source implementation of data-mining algorithms here:
http://www.cs.waikato.ac.nz/ml/weka/

You can use the built-in application or embed it in your own code.
Of course it implements several naive bayes algorithms

Mar 20, 2008 | Computers & Internet

Not finding what you are looking for?
Home Logo

Related Topics:

51 people viewed this question

Ask a Question

Usually answered in minutes!

Top Home Experts

Donni Steen

Level 3 Expert

659 Answers

Tom Chichester

Level 3 Expert

36311 Answers

Brad Brown

Level 3 Expert

16166 Answers

Are you a Home Expert? Answer questions, earn points and help others

Answer questions

Manuals & User Guides

Loading...