473,511 Members | 16,068 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

cpu scheduling problem

My problem is this:
i am currently in taking OS course, and my lecturer would like us to
find ways to construct a CPU algorithm such as SJF(shortest Job
First), SRTF (Shortest Remaining Time First), and since i know not
much about the construction is there anyone who can help me to built
such algorithm? Thankz!
Jul 22 '05 #1
2 4430
Jerry Khoo writes:
My problem is this:
i am currently in taking OS course, and my lecturer would like us to
find ways to construct a CPU algorithm such as SJF(shortest Job
First), SRTF (Shortest Remaining Time First), and since i know not
much about the construction is there anyone who can help me to built
such algorithm? Thankz!


I wouldn't dignify such a thing by calling it an algorithm. Are you sure
you haven't sanitized the exercise too much? From what I see you simply
have a pool of jobs that keeps changing. When you are ready for a new job
you select the best candidate.

BTW, algorithm questions belong in comp.programming, not here.
Jul 22 '05 #2
Jerry Khoo wrote:
My problem is this:
i am currently in taking OS course, and my lecturer would like us to
find ways to construct a CPU algorithm such as SJF(shortest Job
First), SRTF (Shortest Remaining Time First), and since i know not
much about the construction is there anyone who can help me to built
such algorithm? Thankz!


You need to define the problem a bit better, and perhaps post any work
you've done so far.

I would argue that it isn't possible to implement SJF for a general
case(though it is still useful as a theoretically optimal lower bound on
average waiting time). To implement SJF, you need to know for how long
a process is going to run. The only way you can know this (in the
general case) is to run the process and see, but that defeats the point
of trying to schedule when it will run. The same is true for SRTF.

Are you somehow given the running time/remaining time for each process,
or do you have to estimate them? If you must estimate, what information
is available to your algorithm?

If you already have the values available, the algorithm seems as simple
as sorting a list the processes by running time/remaining time, then
sequentially executing each.

Alan
Jul 22 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2874
by: Gilles Leblanc | last post by:
Hi I have started a small project with PyOpenGL. I am wondering what are the options for a GUI. So far I checked PyUI but it has some problems with 3d rendering outside the Windows platform. I...
6
2316
by: Tony Proctor | last post by:
Hi everyone We're experiencing some serious anomalies with the scheduling of ASP threads. I'd be interested to hear if anyone knows what algorithm is used (e.g. simple round-robin, or something...
13
6040
by: Mike | last post by:
Normally scheduling a job is a very elementary operation but for some hidden reason I've been unable to schedule a job which runs on a 28 day cycle, even though I have at least 16 other jobs...
3
2882
by: Muscha | last post by:
Hi, In our application we need to have a high performance scheduling framework. We want to be able to say for item 21 do an update on such and such time. We will have around 1 million items of...
3
1406
by: mirek | last post by:
Hello, My ASP.NET application must have additional functionality which isn't typical for ordinary web use. It is: - connecting to the other server using specified protocol (an option to...
3
578
by: Alphonse Giambrone | last post by:
Can anyone point me toward a good example of an asp.net scheduling app? Preferrably in vb.net. TIA -- Alphonse Giambrone Email: a-giam at customdatasolutions dot us
1
1788
by: Majed | last post by:
hi I'm planing to make scheduling app and need your advice on the best way to do that,and how to save the tasks to be executed and retrive their data at the right time. your input will be highly...
4
2821
by: Dinsdale | last post by:
I'm looking at adding scheduling features to an application and I wanted to ask the community about any experience with scheduling components, either open source like from code project or from a...
2
26803
Ritchie
by: Ritchie | last post by:
Please can anyone help me with d programs in C for CPU scheduling: WAP to show FCFS scheduling algorithm. WAP to show SJF scheduling algorithm. WAP to show Priority scheduling algorithm. WAP...
4
1955
by: IanWright | last post by:
I'm just wondering if anyone could give me any starters here.... I have a need to create a simple scheduling application, that will choose from a pool of avaliable people and assign them to a...
0
7242
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7138
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7353
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7075
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7508
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5662
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3212
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1572
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
781
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.