What is the use of thread over process?
Submitted by: AdministratorThread is an executable entity but it is bound to its parent
process.
now there are two types of threads.
1. user space threads and
2. kernel thread
now the kernel threads are actually known as light weight
processes.
why light weight????
>>>> as it's context switching times is lesser than all
other process.
now why the context switching time is less????
>>>>> as process have there own process address space and
maintains many more things like userID, ProcessID, groupID,
number of files opened, reisters and blah, blah
whereas thread shares it's parent process's address space
and mainly contains three things like own stack, registers
and thread related data.
so more things to swap need more time that's why thread's
context switching time is less compared to that of a process.
now the answer,
use of thread: thread are used to provide multi-programming
environment.
ok, now u ppl would think that, it can also be done creating
new processes (using fork())
yes we can,
but as i told earlier that the context switch time for
threads are very less.
moreover the inter-thread communication is more easier than
inter-process communication as all threads of a single
process uses the same address space.
Submitted by: Administrator
process.
now there are two types of threads.
1. user space threads and
2. kernel thread
now the kernel threads are actually known as light weight
processes.
why light weight????
>>>> as it's context switching times is lesser than all
other process.
now why the context switching time is less????
>>>>> as process have there own process address space and
maintains many more things like userID, ProcessID, groupID,
number of files opened, reisters and blah, blah
whereas thread shares it's parent process's address space
and mainly contains three things like own stack, registers
and thread related data.
so more things to swap need more time that's why thread's
context switching time is less compared to that of a process.
now the answer,
use of thread: thread are used to provide multi-programming
environment.
ok, now u ppl would think that, it can also be done creating
new processes (using fork())
yes we can,
but as i told earlier that the context switch time for
threads are very less.
moreover the inter-thread communication is more easier than
inter-process communication as all threads of a single
process uses the same address space.
Submitted by: Administrator
Read Online Linux Threads Job Interview Questions And Answers
Top Linux Threads Questions
☺ | An extended partition can contain many sub partitions called_______? |
☺ | When performing a Linux installation the____ command can be typed to start the installation without framebuffer support? |
☺ | Suppose we have three threads T1, T2 and T3 which perform sequentially one after another is their any benefit of using thread over here rather than having a single process? |
☺ | At installation, Red Hat Fedora Linux creates a symbolic link called _____ to the appropriate cd-rom device? |
☺ | What is the use of thread over process? |
Top Linux OS Categories
☺ | Device Drivers Interview Questions. |
☺ | Linux OS Management Interview Questions. |
☺ | Linux Makefile Interview Questions. |
☺ | Linux Environment Interview Questions. |
☺ | Linux OS Shell Interview Questions. |