Welcome to Dream.In.Code
Become a Java Expert!

Join 149,991 Java Programmers for FREE! Get instant access to thousands of Java experts, tutorials, code snippets, and more! There are 1,339 people online right now. Registration is fast and FREE... Join Now!




shortest job first (preempitive)algorithm using java

 
Reply to this topicStart new topic

shortest job first (preempitive)algorithm using java

ahmadghost
2 Dec, 2006 - 03:28 AM
Post #1

New D.I.C Head
*

Joined: 25 Nov, 2006
Posts: 5


My Contributions
hiiiii every one ...

is any one know how can i implement the algorithm of operating system ...
---shortest job first (preempitive)algorithm-- using java

please i neeeeeeed your helppppp as sonne as posible


User is offlineProfile CardPM
+Quote Post

msg555
RE: Shortest Job First (preempitive)algorithm Using Java
2 Dec, 2006 - 03:42 AM
Post #2

D.I.C Head
Group Icon

Joined: 4 May, 2006
Posts: 136



Thanked: 5 times
Dream Kudos: 25
My Contributions
Could you explain a little more what this shortest job first algorithm is suppose to do?
User is offlineProfile CardPM
+Quote Post

William_Wilson
RE: Shortest Job First (preempitive)algorithm Using Java
2 Dec, 2006 - 07:12 AM
Post #3

lost in compilation
Group Icon

Joined: 23 Dec, 2005
Posts: 4,101



Thanked: 25 times
Dream Kudos: 3275
Expert In: Java, C, Javascript

My Contributions
i think what ahmadghost is trying to do is read the length of an instruction and then instead of queueing them, to process them in an order based on that length.
This is not how all OS process things, there are many other factors that determine run time, eg: estimated run time, length of wait, data collection, etc. Also with the use of pipelining in hardware quite often the length of the instruction is irrelevent, especially since the classic model right now is to use instructions of all the same length (easier to sinc to the processor pulse).

The biggest questions are why, and how are the instructions received?
User is offlineProfile CardPM
+Quote Post

msg555
RE: Shortest Job First (preempitive)algorithm Using Java
2 Dec, 2006 - 09:10 AM
Post #4

D.I.C Head
Group Icon

Joined: 4 May, 2006
Posts: 136



Thanked: 5 times
Dream Kudos: 25
My Contributions
This looks like the job for a priority queue or min heap.
User is offlineProfile CardPM
+Quote Post

ajwsurfer
RE: Shortest Job First (preempitive)algorithm Using Java
19 Mar, 2007 - 12:11 PM
Post #5

D.I.C Regular
Group Icon

Joined: 24 Oct, 2006
Posts: 298



Thanked: 2 times
Dream Kudos: 50
My Contributions
Here is a form about this in C++. I have posted my thoughts about this there.

http://dreamincode.net/forums/showtopic25158.htm
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/8/09 08:06PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live Java Help!

Java Tutorials

Reference Sheets

Java Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month