The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+12 votes
971 views

Draw the process state transition diagram of an OS in which (i) each process is in one of the five states: created, ready, running, blocked (i.e., sleep or wait), or terminated, and (ii) only non-preemptive scheduling is used by the OS. Label the transitions appropriately.

asked in Operating System by Veteran (59.5k points)
edited by | 971 views
0
where is the answer for a) ?
0

2 Answers

+8 votes

B.

  1. 1st blank $-$ TestandSet(mutex).
    2nd blank $-$ mutext $=0$;
     
  2. no.
     
  3. say given procedure is not atomic. 1st execute process $p1$. After $A1 \ p1$ is preempted. 2nd process $p2$ now executes full code and enters critical section.  $P1$ resumes and completes the code and enters critical section. So $2$ processes are now in critical section.
answered by (167 points)
edited by
0
is this deadlock free??why and why not??
+13
It is deadlock free but not starvation free.
+1

It's correct: TestandSet(mutex) but use & i.e. TestandSet(&mutex)

0
It is deadlock free because if any one process executes the enter-cs method and calls the atomic TEST-AND-SET instruction, it will be returned what the value of the mutex was when it called the atomic TEST-AND-SET instruction, hence the loop will only terminate if the value of mutex was 0 when the function was called. This will only happen when mutex is assigned to 0 which is in the leave-cs method. So busy waiting will occur, but it will never happen that all processes get blocked, never to be resumed.
0 votes

Process state transition diagram for an OS which satisfy below criteria -

i) each process is in one of the five states: created, ready, running, blocked (i.e., sleep or wait), or terminated, and

ii) only non-preemptive scheduling is used by the OS.

 

Lightbox

 

If in question it is asked about the preemptive scheduling then after running state a process directly go to ready state.

answered by Active (1.9k points)

Related questions



Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

38,080 questions
45,572 answers
132,070 comments
49,047 users