Suppose you have a system that supports both user- and kernel- level threads. Which kind of threading do you prefer (or does it make any difference) if:
1. applications are highly compute (CPU) bound and perform almost no system calls?
2. applications do a lot of I/0 (so, lots of system calls) in addition to CPU work?
1--
when there are almost no system calls, then both user and kernel level threads are good.But user level threads are preferred because,it doesn't need support from the operating system and context switch time is less.
2--If the application has lot of system calls ,it is better to use kernel level threads because,if we use user level threads and one of thread makes a blocking system call, then entire process is blocked.But this is not the case with kernel level threads.Hence kernel level threads are preferred.
Get Answers For Free
Most questions answered within 1 hours.