What is the difference between Process and Threads?
Answers were Sorted based on User's Feedback
Answer / rekha
A Procees is an execution of program but a thread is a
single execution sequence within a process(and so called
a "light weight process").
A process can contain n number of threads.
Is This Answer Correct ? | 168 Yes | 11 No |
Answer / sathya
Process are heavy weight programs which consume considerable
amnt of memory for execution and are heavily dependent on
system resources for their execution
Threads are light weight and use the min available sys
resources as a whole and can execute simultaneously to
acheive a given task.
Is This Answer Correct ? | 130 Yes | 23 No |
Answer / shani kr. gupta
Process is a program in execution.
Suppose there r two processes that means that occurs at
different-different memory location. and the context
switching b/w process is more expensive.bcz it will take
more time from one memory allocation to other memory
allocation.that is why Process is called HEAVY WEIGHT PROCESS.
Thread is smallest part of program.and It is independent
sequential path of execution with in a program.
Suppose there r two threads that means that occurs at same
memory location bcz of smallest part of program.
and the context switching b/w threads is less expensive
rather than process.that is why Thraed is called Light
WEIGHT PROCESS.
Is This Answer Correct ? | 84 Yes | 9 No |
Answer / biswajit padhan
The major difference between threads and processes is
1.Threads(Light weight Processes) share the address space
of the process that created it; processes have their own
address
.2.Threads have direct access to the data segment of its
process; processes have their own copy of the data segment
of the parent process.
3.Threads can directly communicate with other threads of
its process; processes must use interprocess communication
to communicate with sibling processes.
4.Threads have almost no overhead; processes have
considerable overhead.
5.New threads are easily created; new processes require
duplication of the parent process.
6.Threads can exercise considerable control over threads of
the same process; processes can only exercise control over
child processes.
7.Changes to the main thread (cancellation, priority
change, etc.) may affect the behavior of the other threads
of the process; changes to the parent process does not
affect child processes.If we consider running a word
processing program to be a process, then the auto-save and
spell check features that occur in the background are
different threads of that process which are all operating
on the same data set (your document).
Is This Answer Correct ? | 62 Yes | 7 No |
Answer / dinesh tiwari
A process is an instance of an running application.
And a Thread is the execution stream of the process.
A process can have multiple threads.
Is This Answer Correct ? | 30 Yes | 6 No |
Answer / shilpi
In Process switching time consume
but thread does not consume switching time.
Is This Answer Correct ? | 20 Yes | 11 No |
Answer / srinivas
Thread is nothing but functionality(group of statements)
which could be executed simultaneously with the other part
of the program, with the concept of each other.
Where as a process is nothing but 'a program which is under
execution'. Thread is a part of the process
Is This Answer Correct ? | 6 Yes | 0 No |
Answer / kamran
The key difference is that processes are fully isolated
from each other; threads share (heap) memory with other
threads running in the same application.
Is This Answer Correct ? | 17 Yes | 12 No |
Answer / alok mmmec gkp
THE BASIC DIFFERENCE B/W THREADS AND PROCESSS IS THAT
THREAD CONTAINS A STACK IN WHICH USER N KERNAL PROCESS ADDRESS
ARE STORED
FOR EVERY STEP A NEW PROCESS IS CREATED IN THE PLACE OF IT
THREADS USES ITS STACK
Is This Answer Correct ? | 28 Yes | 24 No |
Answer / yash modi
In threading environment,one portion of program can run
independently of other portions.
Is This Answer Correct ? | 4 Yes | 1 No |
Difference between swing and awt?
How to do registration form using struts and hibernate?
Why does the tag url-encode javascript and mailto links?
why we use main in java?
What is a class loader?
Write a program on RMI and JDBC using StoredProcedure?
Which characters may be used as the second character of an identifier, but not as the first character of an identifier?
Why use a datasource when you can directly specify a connection details? (in a J2EE application)
whats is mean by class.forName() whats the return type of class
What is the diffrence between a local-tx-datasource and a xa-datasource? Can you use transactions in both?
How to synchronize jsp page?
Explain the life cycle of servlet?