Describe the difference between a Thread and a Process?
Answers were Sorted based on User's Feedback
Answer / guest
We can have multiple threads in a single process.Thus we
can say threads are working units of a process.
|Is This Answer Correct ?||32 Yes||9 No|
Answer / anshu
A thread is building block of process, there can be
multiple thread or at least one thread per process.
Process is self loadable but thread need a process to run.
|Is This Answer Correct ?||16 Yes||1 No|
Answer / nk
We can execute a process (EXE) but threads can be created
and executed from inside a process
|Is This Answer Correct ?||8 Yes||1 No|
Answer / subbu
process is self loadable
thread is depends on operating system
communication is possible between processes through some
ex:shared memory, message queues
communication is possible between threads directly
|Is This Answer Correct ?||10 Yes||5 No|
Answer / nahom tijnam
Thread is the basic unit of execution in a computer processor.
Process is an instance of a program that is executed sequentially. So when you fire up an application in your computer, you are starting a process.
Process consists of one or more threads. Single Threaded applications when run have a process with a single thread. Similarly, Multi-threaded applications (MTA) when run have a process with multiple threads.
In an MTA, the different threads can access the resources (like memory) owned by its process.
|Is This Answer Correct ?||5 Yes||0 No|
Answer / nalin jayasuriya
A thread consists of a series of computer instructions...
and usually corresponds to the CPUs execution of a series
of instructions. Threads use the registers and the 'stack'
as its memory (state).
A process contains at least one thread and private memory.
A process is the operating system loads when one executes a
program. When a process contains multiple threads, there is
usually thread synchronization needed.
In Windows programming, the primary thread is what creates
the user-interface controls and it's that thread that is
allowed exclusive privileges to update the user-interface.
In Windows programming, a process receives and sends
messages to the operating system.
|Is This Answer Correct ?||5 Yes||0 No|
Answer / p suresh kumar
Thread uses shared memory. But process uses different
|Is This Answer Correct ?||5 Yes||1 No|
Answer / rahul
A process is a collection of virtual memory space, code, data, and system resources. A thread is code that is to be serially executed within a process. A processor executes threads, not processes, so each application has at least one process, and a process always has at least one thread of execution, known as the primary thread. A process can have multiple threads in addition to the primary thread
Thread – is stream of executable code within process. They are light weight process.
All thread with in a process share process instruction,code & data segment,open file descriptor,signal handler,userID and GroupID. Thread has its own set of register including program counter,stack pointer
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 ?||4 Yes||1 No|
Answer / priyanka agrawal
1. We can execute a process but threads can be created
and executed from inside a process.
2. thread uses shared memory but process uses different
|Is This Answer Correct ?||2 Yes||0 No|
WAP to generate 2n+1 lines of the following pattern on the computer screen:
what is new modifier in C#
what is the difference between class and structure in C++?
what is the difference between ERROR and EXCEPTION?
What is multidimensional array?
Differences between inline functions and non-inline functions?
What is the fundamental idea of oop?
define oops with class and object
What is a scope resolution operator?
Program to check whether a word is the first word of the sentence.
whats the difference between c and c++
What is R T T I ?