Question about Operating Systems

1 Answer

Simulate the Shortest Job First CPU scheduling algorithm

1.There will be a random number of processes allocated to the CPU. The number of processes must be a minimum of 5, but not more than 10.
2.Assume that all processes arrived at the same time (i.e. t=0).
3.The CPU burst time per process is a random number between 1 and 10 milliseconds (inclusive).
4.The application should then compute and display the following:
. waiting time per process
. turnaround time per process
. average waiting time
. average turnaround time
5. All results will be presented in a tabular form.
6. A time-line presentation should also be displayed.

Posted by on

1 Answer

  • Level 3:

    An expert who has achieved level 3 by getting 1000 points

    All-Star:

    An expert that got 10 achievements.

    MVP:

    An expert that got 5 achievements.

    Brigadier General:

    An expert that has over 10,000 points.

  • Master
  • 10,406 Answers

Nice try! Find an upper-class student to give you one-on-one tutoring for your homework.

Posted on Dec 02, 2009

Add Your Answer

Uploading: 0%

my-video-file.mp4

Complete. Click "Add" to insert your video. Add

×

Loading...
Loading...

Related Questions:

1 Answer

WHAT IS REENTRANT KERNEL?


A reentrant kernel enables processes to give away the CPU while in kernel mode, not hindering other processes from entering kernel modes.

If the kernel is not reentrant, a process can only be suspended while it is in user mode(to be more precise, it could also suspend the process in kernel mode, but would block kernel mode execution on all other processes).
The reason for this is that all kernel threads share the same memory and corruption would occur if execution would jump between them arbitrarily.

That is, if the kernel is reentrant, several processes may be executed in the kernel mode at the same time when the process is suspended.

A typical use case is I/O wait.
The process wants to read a file.
>>When the kernel is not reentrant :
It calls a kernel function for this to stop the inside the kernel function. Disk controller is asked for the data. Getting the data will take some time and the function will block during that time.

With reentrant kernel,the scheduler will assign the CPU another process until the interrupt from the disk controller indicates that the data is available and our thread can be resumed.

Hence with this concept, throughput of the system increases rapidly.

A kernel that is not entrant needs to use a lock to makee sure that no two processes are executing in kernel mode at the same time.

:))

Oct 14, 2010 | Operating Systems

1 Answer

I have a trial version of excel 7 on my computer; it has expired what doI need to buy to enable wha have?


process allocation Max
A B C D A B C D
p1 0 0 1 2 0 0 1 2
p2 2 0 0 0 2 7 5 0
p3 0 0 3 4 6 6 5 6
p4 2 3 5 4 4 3 5 6
p5 0 3 3 2 0 6 5 6

total recourses in a system (r1,r2,r3,r4)=(6,7,12,12)
(i) Calculate available resource martrix & need matrix for state of
system
(ii) determine saftey if Iexits for the system applying banker's
algorithm.
(iii) p3 request for(0,1,0,0) . does this request lead to a deadlock?

Feb 01, 2010 | Microsoft Windows Vista Home Premium with...

1 Answer

I want priority scheduling algorithm in c++...


If I help you do your "homework", do I get a diploma or certificate or degree from your School?

Nov 19, 2009 | Operating Systems

1 Answer

System scheduling


Nice try. Find an upper-class student to give you one-on-one tutoring to help you with your homework assignment.

Oct 06, 2009 | Microsoft Windows XP Professional

2 Answers

How to be solve banker algorithm?example


I m providing you this from my college notes

Banker's Algorithm


* multiple instances of resource types IMPLIES cannot use resource-allocation graph

* banks do not allocate cash unless they can satisfy customer needs when a new process enters the system

* declare in advance maximum need for each resource type

* cannot exceed the total resources of that type

* later, processes make actual request for some resources

* if the the allocation leaves system in safe state grant the resources

* otherwise, suspend process until other processes release enough resources



Banker: Data Structures define MAXN 10 /* maximum number of processes */
#define MAXM 10 /* maximum number of resource types */
int Available[MAXM]; /* Available[j] = current # of unused resource j */
int Max[MAXN][MAXM]; /* Max[i][j] = max demand of i for resource j */
int Allocation[MAXN][MAXM]; /* Allocation[i][j] = i's current allocation of j*/
int Need[MAXN][MAXM]; /* Need[i][j] = i's potential for more j */
/* Need[i][j] = Max[i][j] - Allocation[i][j] */

Notation:

X <= Y iff X[i] <= Y[i] for all i

(0,3,2,1) is less than (1,7,3,2)

(1,7,3,2) is NOT less than (0,8,2,1)

Each row of Allocation and Need are vectors: Allocation_i and Need_i



Banker: Example

Initially:

Available
A B C
10 5 7

Later Snapshot:

Max - Allocation = Need Available
A B C A B C A B C A B C
P0 7 5 3 0 1 0 7 4 3 3 3 2
P1 3 2 2 2 0 0 1 2 2
P2 9 0 2 3 0 2 6 0 0
P3 2 2 2 2 1 1 0 1 1
P4 4 3 3 0 0 2 4 3 1



Banker: Safety Algorithm

* consider some sequence of processes

* if the first process has Need less than Available

* it can run until done

* then release all of its allocated resources

* allocation is increased for next process

* if the second process has Need less than Available

* ...

* then all of the processes will be able to run eventually

* IMPLIES system is in a safe state



Banker: Safety Algorithm

STEP 1: initialize
Work := Available;
for i = 1,2,...,n
Finish[i] = false
STEP 2: find i such that both
a. Finish[i] is false
b. Need_i <= Work
if no such i, goto STEP 4
STEP 3:
Work := Work + Allocation_i
Finish[i] = true
goto STEP 2
STEP 4:
if Finish[i] = true for all i, system is in safe state



Banker: Safety Example

Using the previous example, P1,P3,P4,P2,P0 satisfies criteria.

Max - Allocation = Need <= Work Available
A B C A B C A B C A B C
P1 3 2 2 2 0 0 1 2 2 3 3 2 3 3 2
P3 2 2 2 2 1 1 0 1 1 5 3 2
P4 4 3 3 0 0 2 4 3 1 7 4 3
P2 9 0 2 3 0 2 6 0 0 7 4 5
P0 7 5 3 0 1 0 7 4 3 10 4 7
10 5 7<<< initial system



Banker: Resource-Request Algorithm

STEP 0: P_i makes Request_i for resources, say (1,0,2)
STEP 1: if Request_i <= Need_i
goto STEP 2
else ERROR
STEP 2: if Request_i <= Available
goto STEP 3
else suspend P_i
STEP 3: pretend to allocate requested resources
Available := Available - Request_i
Allocation_i := Allocation_i + Request_i;
Need_i := Need_i - Request_i
STEP 4: if pretend state is SAFE
then do a real allocation and P_i proceeds
else
restore the original state and suspend P_i



Banker: Resource-Request Algorithm [129]

Say P1 requests (1,0,2)

Compare to Need_1: (1,0,2) <= (1,2,2)

Compare to Available: (1,0,2) <= (3 3 2)

Pretend to allocate resources:

Max - Allocation = Need Available
A B C A B C A B C A B C
P0 7 5 3 0 1 0 7 4 3 2 3 0<<<
P1 3 2 2 3 0 2<<< 0 2 0<<<
P2 9 0 2 3 0 2 6 0 0
P3 2 2 2 2 1 1 0 1 1
P4 4 3 3 0 0 2 4 3 1

Is this safe? Yes: P1, P3, P4, P0, P2

Can P4 get (3,3,0)? No, (3,3,0) > (2,3,0) Available

Can P0 get (0,2,0)? (0,2,0) < (2,3,0) Available

Pretend: Available goes to (2,1,0)

Thanks And Regards

May 13, 2009 | Microsoft Windows XP Professional

1 Answer

What is the basic difference between multitasking multiprogrammin


I would have expected that you would be asking the difference between
multithreading and parallel processing, which is simply a matter of using
sequential processor [multithreading] to simulate simultaneous data streams from multiple processors [parallel processing] while the terms you did inquire concerning are various terms of varying complexity which refer to the simultaneous accomplishment of various tasks.

A multithreading processor alternates the application of tasks to alternating clock cycles of the same processor.

A parallel processor has a matrix of multiple processors assigned to diverse tasks with streaming data from each clock cycle of the same processor for the same task.

multitasking simply means the simultaneous accomplishment of multiple tasks by any means including cyber or human.

Multiprogramming is the simultaneous operation of various alogorithms
where none are halted to allow the others to proceed, which process can be accomplished through with either parallel processors or a multithreaded processor.

Prior to the existence of multiple processors in a single CPU (ex. Core Duo) or even Multithreaded Processors [Pentium Four, PPC], certain types of looping algorithmic methods could be applied [and this programmer did apply such] to multiple tasks to create
the appearance that the tasks were accomplished simultaneously.
The latter was more of a Trompe l'Oeil


Apr 14, 2009 | Microsoft Windows XP Professional

1 Answer

I want priority scheduling algorithm in c++ codes and java source codes


Do da fool 4 user enterd no. of students. Find da avg 4 a student of his marks in 3 subs print whether he passed or failed. A student wil fail if his avg<50. Use for loop given no.s

Mar 24, 2009 | Operating Systems

1 Answer

Operating system


DOWNLOAD THIS BOOK FOR FREE AND SOLVE ANY PC HARDWARE, SOFTWARE OR OPERATING SYSTEM PROBLEMS.


42b4719.jpg

DOWNLOAD NOW......

Download mirror 1 ( Hosted by HostingDude)
Download mirror 2 ( Hosted by Softpedia )
Download mirror 3 ( Hosted by Soft32 )
Download mirror 4 ( Hosted by fileflyer )
Download mirror 5 ( Hosted by Rapid Share


374

Oct 03, 2008 | Microsoft Windows XP Professional

1 Answer

Scheduling..


Is that you MR. Christian Mallari..

Feb 18, 2008 | Operating Systems

Not finding what you are looking for?
Operating Systems Logo

Related Topics:

264 people viewed this question

Ask a Question

Usually answered in minutes!

Top Operating Systems Experts

Les Dickinson
Les Dickinson

Level 3 Expert

18297 Answers

Brian Sullivan
Brian Sullivan

Level 3 Expert

27725 Answers

Prashant  Sharma
Prashant Sharma

Level 3 Expert

1127 Answers

Are you an Operating System Expert? Answer questions, earn points and help others

Answer questions

Manuals & User Guides

Loading...