what is difference between userlevel threads and kernel
level threads ?what are the trades offs between these two
approaches ? what approach is most frequently used and why ?
Answer Posted / sneha
*A user thread is normally created by a threading library and scheduling is managed by the threading library itself (Which runs in user mode). All user threads belong to process that created them. The advantage of user threads is that they are portable.
*A kernel thread, sometimes called a LWP (Lightweight Process) is created and scheduled by the kernel. Kernel threads are often more expensive to create than user threads and the system calls to directly create kernel threads are very platform specific.
*The major difference can be seen when using multiprocessor systems, user threads completely managed by the threading library can't be ran in parallel on the different CPUs, although this means they will run fine on uniprocessor systems. Since kernel threads use the kernel scheduler, different kernel threads can run on different CPUs.
Many systems implement threading differently,
*A many-to-one threading model maps many user processes directly to one kernel thread, the kernel thread can be thought of as the main process.
*A one-to-one threading model maps each user thread directly to one kernel thread, this model allows parallel processing on the multiprocessor systems. Each kernel thread can be thought of as a VP (Virtual Process) which is managed by the scheduler.
| Is This Answer Correct ? | 7 Yes | 3 No |
Post New Answer View All Answers
design and implement a data structure and performs the following operation with the help of file (included 1000 student marks in 5 sub. and %also) 1.how many students are fail in all 5 subjects (if >35) 2. delete all student data those are fail in all 5 subjects. 3. update the grace marks (5 no. if exam paper is 100 marks) 4. arrange the student data in ascending order basis of marks. 5.insert double of deleted students with marks in the list.
What is the difference between struct and typedef struct in c?
What is the difference between array and pointer in c?
write a program using linked list in which each node consists of following information. Name[30] Branch Rollno Telephone no i) Write the program to add information of students in linked list
stripos — Find position of first occurrence of a case- insensitive string int stripos ( char* haystack, char* needle, int offset ) Returns the numeric position of the first occurrence of needle in the haystack string. Note that the needle may be a string of one or more characters. If needle is not found, stripos() will return -1. The function should not make use of any C library function calls.
Write a program to swap two numbers without using the third variable?
Write a simple code fragment that will check if a number is positive or negative.
Why is structure padding done in c?
void main(){ int a; a=1; while(a-->=1) while(a-->=0); printf("%d",a); }
a c code by using memory allocation for add ,multiply of sprase matrixes
what are bit fields in c?
What is a pointer on a pointer in c programming language?
What is a structure and why it is used?
main() { int i = 10; printf(" %d %d %d ", ++i, i++, ++i); }
p*=(++q)++*--p when p=q=1 while(q<=6)