The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
+17 votes

Consider the following statements with respect to user-level threads and kernel-supported threads

  1. context switch is faster with kernel-supported threads

  2. for user-level threads, a system call can block the entire process

  3. Kernel supported threads can be scheduled independently

  4. User level threads are transparent to the kernel

Which of the above statements are true?

  1. II, III and IV only
  2. II and III only
  3. I and III only
  4. I and II only
asked in Operating System by Veteran (69k points) | 3.2k views
What is the meaning of 4th statement?
You can say are independent of that.
why context switch is slower in kernel ?
thread switching in user /kernel mode

context switching in user/kernel mode

whts the difference between these two ?

2 Answers

+37 votes
Best answer

Answer A

I) User level thread switching is faster than kernel level switching. SO I is false.

II) & III)  is true.

IV) User level threads are transparent to the kernel

This is little confusing .if you search define transparent on google, you get definations like "(of a material or article) allowing light to pass through so that objects behind can be distinctly seen."->"transparent blue water"", "

easy to perceive or detect."->"the residents will see through any transparent attempt to buy their votes"
This makes it all confusing .Though if go & check more defination
(of a process or interface) functioning without the user being aware of its presence.
So in case of Computing transparent means functioning without being aware. In our case user level threads are functioning without kernel being aware about them. So IV is actually correct. (Even though other defination of transparent disagree to it !)


answered by Veteran (49.5k points)
selected by

The meaning of Transparent is what's confusing!

Once you know that it's pretty easy! check  this out!

+23 votes

User level threads can switch almost as fast as a procedure call. Kernel supported threads switch much slower. So, I is false. 

II, III and IV are TRUE. So A. 

"The kernel knows nothing about user-level threads and manages them as if they were single-threaded processes"



answered by Veteran (346k points)

@Anirudh @Kapilp @Arjun sir, Are the following transparent to OS $\Rightarrow$

  1. Secondary Memory
  2. Hardware
  3. Cache Memory
@Arjun Sir Please comment on above querry.
1) when process request for I/O.Then it is the responsibility of OS to allocate the appropriate I/O devices to process.All external devices are controlled by kernel through device drivers.So we can say that secondary memory is not transparent to the OS.

2)OS has full access to all hardware devices and same for the above reason it can not be transparent to the OS.

3)Cache is part of the CPU.and I think Cache can work without being aware of OS.So, it is transparent to the OS.
then how cache is allocated for hit and miss??

and whom it is not transparent???

 Arjun sir 

case 1:

context switch between user mode -user mode is more than user mode-kernel mode, becoz context switch only occur in kernel mode then for user-user we have to first switch in kernal and save all pcb ,register.but for user -kernel we only need system call

case 2:now

context switch time is less in user level thread .

I am not getting why this is less for user level thread ?



context switch time is less in user level thread .

I am not getting why this is less for user level thread ?

Creating a new thread, switching between threads, and synchronizing threads are done via procedure call. i.e no kernel involvement. 

On the other hand, for kernel level thread, there's always kernel involved which eventually slows down the switch.

 Neelay my both cases are contradicts to each other thts why m saying why less ?

they are not contradicting, the first case is correct, as context switch between two user processes involves

Switching to kernel mode + Saving the context

And to switch to kernel mode, its about setting the $mode$ bit to $1$

And for the second case I gave you the reason, there's no kernel involvement as such. And this is in comparison to kernel level threads. So don't confuse with processes and threads!
thnks a lot :)

now got my mistake .i am considering process instead of thread.

thnks again

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

33,705 questions
40,253 answers
38,862 users