Solved

CPU SCHEDULING ALGORITHMS

Posted on 2004-04-19
3
1,272 Views
Last Modified: 2008-02-01
I would like to write a programme of a process scheduling system that have three queues [SJF,Round Robin RR, and FCFS].  I do have a file of list of processes with the following attribuates  [processes ID, burst time, start time, n file size] to be inserted in the three queues.  a process is placed in a queue when its start time is >=  to the clock time. The CPU attempts to read the processes in the following order :-
 i) Execute all processes in SJF-Q first.
ii) If SJF-Q is empty then execute all processes in RR-Q. If a new job is entered into SJF-Q then
once the existing RR-Q job finishes, or completes it’s quantum, RR-Q cannot access the
CPU until all the processes in SJF-Q have been completed.
iii) Likewise processes in FCFS-Q can start once  SJF-Q and RR-Q are empty, although if a new job
is placed into SJF-Q or RR-Q then upon completion of the current job (from FCFS-Q) in the
CPU, FCFS-Q cannot access to the CPU until both SJF-Q and RR-Qare empty again.
The queue where a process should go is determined by its burst time.
 

I need also to compute the average waiting time of the processes to start over the entire  3 Qs . and also an average waiting time of each queue.

please I need hints on how to implement the code.  I'm lost and I donn't know how to start.

Thank you very much
0
Comment
Question by:sh7tot
3 Comments
 
LVL 45

Accepted Solution

by:
sunnycoder earned 125 total points
ID: 10865874
check the /usr/src/linux/kernel/sched.c file in any linux machine ... It has source code for round robin and FCFS algorithms .... once you get a hang of it, implementing SJF should not be much difficult

>please I need hints on how to implement the code.
Break down your problem into smaller sized, manageable chunks e.g.
1. read information from file
2. form queues
3. execute tasks

Since in your problem, requests are not arriving dynamically, the task is considerably easier ...

Since this is system programming homework assignment, I assume that you would be using C on a linux/solaris box

Reading information from file is trivial enough ... it is devising a data structure in which to store information that needs some thought ... Do you use arrays or linked lists or doubly linked lists and why ?

the problem is relatively strainght-forward ... think along these lines and if you get stuck, ask here
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

I have published numerous articles here at Experts Exchange that present programs/scripts written in a language called AutoHotkey. Each of those articles has a brief paragraph describing where to download the product and how to install it. I have al…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now