wood burning stoves 2.0*
The moose likes Java in General and the fly likes Homework problem help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Homework problem help " Watch "Homework problem help " New topic
Author

Homework problem help

Jillian Snyder
Greenhorn

Joined: Sep 01, 2012
Posts: 3
I am in understanding pertaining systems and don't understand SJN or this problem can anyone explain in depth?
Five jobs (A, B, C, D, E) are already in the READY queue waiting to be processed. Their estimated CPU cycles are respectively: 2, 10, 15,6, and 8. Using SJN, in what order should they be processed?
Thank you
John Jai
Bartender

Joined: May 31, 2011
Posts: 1776
Welcome to Javaranch, Jillian. Please CarefullyChooseOneForum.
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074
    
  16

What is "SJN"?


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Steve Fahlbusch
Bartender

Joined: Sep 18, 2000
Posts: 557
    
    7

Smallest Job Next
Stuart A. Burkett
Ranch Hand

Joined: May 30, 2012
Posts: 679
Jillian Snyder wrote:Their estimated CPU cycles are respectively: 2, 10, 15,6, and 8. Using SJN, in what order should they be processed?
Thank you

And once you've answered Jesper's question (try Google), the answer to your question will be obvious.
Vishal Shaw
Ranch Hand

Joined: Aug 09, 2012
Posts: 179
Hi,

By SJN, I assume you mean Shortest Job Next, right? We used to call it Shortest Job first.
It's a scheduling algorithm, that chooses the shortest available job from the pool and assign it to the thread for execution.

So, it's quite simple.
I assume that all the jobs arrive at the same time. So based on the algorithm, you can easily say what the order should be .
Also please read about these algorithms before posting your homework in forum.

Cheers.
Vishal


Programming is about thinking, NOT coding
Vishal Shaw
Ranch Hand

Joined: Aug 09, 2012
Posts: 179
My post was going to be third. How fast the world changed !!!
 
 
subject: Homework problem help
 
Similar Threads
5 Golden Rules of widening, boxing & varargs
commit to head and branche
not getting the EL
Stop form data load on click of refresh button
Panel Grid and render attribute