in Operating System reshown by
502 views
0 votes
0 votes
Consider two processes X and Y with X and Y having P and Q threads with equal time slices respectively. Threads are mixed with user level threads (ULT) and kernel level threads (KLT) and
P < Q. Now consider the following statements
I) If all threads are user level threads (ULT) then Y excutes (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.

Which of the above statements are TRUE?

I AM NOT ABLE TO UNDERSTAND THESE STATEMENTS MEANING PLEASE HELP
in Operating System reshown by
502 views

4 Comments

user level threads are scheduled by the thread library and not by the kernel. The thread library contains code for creating and destroying of threads, for scheduling threads, for saving and restoring thread contexts, etc. What gets scheduled by the kernel in this case are the processes themselves. Thread scheduling happens in ULT systems in the user mode and the process itself is the only thing that is handled by the kernel scheduler. So How can (I) be true?It is totally dependent on the application as scheduling is application-specific for ULT.
0
0
But if that user level thread need to access any hardware or memory or devices... How will it do that?
0
0
the corresponding process which is scheduled by the kernel will access hardware and memory devices by making the respective system calls. The OS has no idea about user level threads. What it thinks it schedules, are the processes. When a process is in the CPU, it is up to each thread within a process to relinquish the control to other threads.
1
1

1 Answer

0 votes
0 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.