Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Homework problem help

 
Jillian Snyder
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 1776
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to Javaranch, Jillian. Please CarefullyChooseOneForum.
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15207
36
Android IntelliJ IDE Java Scala Spring
 
Steve Fahlbusch
Bartender
Posts: 602
7
Mac OS X Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Smallest Job Next
 
Stuart A. Burkett
Ranch Hand
Posts: 679
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 179
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Vishal Shaw
Ranch Hand
Posts: 179
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My post was going to be third. How fast the world changed !!!
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic