Solved

CPU SCHEDULING ALGORITHMS

Posted on 2004-04-19
3
1,284 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
Make the most of your online learning experience.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

632 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