Go Back   CodingForums.com > :: Server side development > Java and JSP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-12-2012, 05:22 AM   PM User | #1
godz1990
New to the CF scene

 
Join Date: Oct 2012
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
godz1990 is an unknown quantity at this point
Round Robin and Shortest Process Next Algorithm for OS

Deleted post.

Last edited by godz1990; 10-13-2012 at 08:03 PM..
godz1990 is offline   Reply With Quote
Old 10-12-2012, 07:12 PM   PM User | #2
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,650
Thanks: 4
Thanked 2,451 Times in 2,420 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
This is way too much code to go through without having an actual question associated with this. Just saying its buggy won't help unless you've done some debugging of your own to determine the cause.
Needless to say, I think you are going way to complicated here. Taking a vector of a Process instead of integer would make more sense to me. Finding shortest runtime would be as simple as sorting it by the process run duration (haven't a clue what that is since there's no definition for Process) descending, and picking the first item. Make use of a linked list built as a priority queue for queuing up the next set of processes that are ready based off of the run information. I assume the full run duration would effectively consume cpu. Unknown is if the example runtime includes or excludes the required time used to access the harddisk. In that first example, that could be 5000 including all access (which will be deficient, but makes sense for some of the assignment criteria), or it could be 5000 excluding access to disk (for a total of 800x4+5000 or 8200).

This is a neat and complicated assignment. I think this would be easier if used in a threaded model (with synchronized lists of course), but there is no mention here to use threading which is why I think its more complex than it needs to be.

If you can come up with some more specific issues to identify, then that would be much better. There is just too much here to go through in order to point out an ah-hah! relating to a cause.
Fou-Lu is offline   Reply With Quote
Users who have thanked Fou-Lu for this post:
godz1990 (10-13-2012)
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:57 PM.


Advertisement
Log in to turn off these ads.