edited by
1,201 views
1 votes
1 votes
Consider two processes X having P threads and Y having Q threads with equal time slices respectively.Threads are mixed with user level threads (ULT) and kernel level threads (KLT) with P > Q. Now consider the following statements

 
I) If all threads are user level threads (ULT) then Y executes (Q/P) times more faster than X.
II) If all threads are Kernel level threads (KLT) then Y gets (Q/P) times more CPU time than X.
III) If all P are ULT and Q are KLT then X takes more context switching time than Y.

Which of the above statements are TRUE.

1. III only
2. II and III only
3. I and II only
4.I, II and III

 

 

How statement-1 Is true??
edited by

3 Answers

2 votes
2 votes
None of the statements and none of the options are correct.

Statement-1 is wrong because both processes X and Y will get CPU for the same quantums of time. CPU doesn't know about the user level threads. Then how can anyone one process execute faster?

Statement-2 is wrong. Y gets lesser time than X because P>Q.

Statement-3 is wrong. Y takes more context switching time than X.
0 votes
0 votes
You can answer this by eliminating options.

III statement where all P is ULT when X is scheduled switching between threads is register switch which takes lesser time compared to context switch. Q kernel level threads will be scheduled independently of Y and switching between threads is a context switch. So think of it like Q + 1(X) processes to be scheduled on CPU. Therefore it's clear that Y takes more time than X due to context switch for switching between each thread. All options other than 3. contains III, therefore, 3. is the answer.
0 votes
0 votes

and statement III is wrong.

Related questions

10 votes
10 votes
3 answers
4
Akriti sood asked Dec 20, 2016
2,479 views
can anyone tell what are different activities that are performed in kernel modeuser modehow to change frm user mode to kernel mode and vice-versa,,