What is the use of thread over process?
Answers were Sorted based on User's Feedback
Answer / sandeep patra
Thread 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.
Is This Answer Correct ? | 61 Yes | 7 No |
Answer / vinay verma
Thread is a lightwait processes .it use the same resource of
main process(parant process)and it runs in the same address
space of main program .
Is This Answer Correct ? | 38 Yes | 12 No |
Answer / mohan reddy.k.v
Thread is nothing but a normal process which shares some of
the resources with its parent, so that it decreases burden
of creating shared resources again.
Is This Answer Correct ? | 26 Yes | 19 No |
Answer / aditya ganjiwale
Thread is sequence of execution. It is lighwieght process
hence it share a minimum resources
Is This Answer Correct ? | 10 Yes | 5 No |
Answer / angel
Thread is a light weight process. It executes some line of
code independent of current execution. Threads are faster is
processing as compared to process. Process have their own
address space but threads share the same address space of
process under which process they are. So context switching
happened much faster in case of threads.
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / sachin tyagi
thread is part of process.it is a lightweight component
because threads take same memory area.we use threads for
faster execution.
Is This Answer Correct ? | 2 Yes | 3 No |
Answer / mohit sharma
Thread is a light weight process used to faster the processing of a process by using the time sharing technique by which a single process is divided into multiple threads and all they work together to make quick execution time. They all share the same address space..
Is This Answer Correct ? | 2 Yes | 3 No |
Answer / sharmila
thread is the actual executing entity inside a process
whereas a process is much more. Normally,a process will
have a single thread of execution
Is This Answer Correct ? | 11 Yes | 14 No |
Answer / nayan
all threads can use the same global memory whereas
communication between process will happen via IPC
Is This Answer Correct ? | 6 Yes | 11 No |
Answer / krishna
threads are the process stimulators which actually aid and
help in executing the process faster more the threads
faster the processing
Is This Answer Correct ? | 19 Yes | 27 No |
Can one thread run on multiple cores?
how will you distinguish if it is a process or a thread, provided you know pid in linux operating system?
0 Answers SwanSoft Technologies,
What are the advantages of threads?
How many threads can one core handle?
What are threads and processes?
What is difference between processes and threads?
What is context switching between threads?
how can i tell how much memory linux is using?
Are cpu threads important?
How many maximum threads can you create?
Which one is better thread class or runnable interface?
What is the main disadvantage of user level threads?