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
1)
process is self loadable
while
thread is depends on operating system
2)
communication is possible between processes through some
mechanism
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
memory.
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
memory.
Is This Answer Correct ? | 2 Yes | 0 No |
What is constructor in oop?
Can static class have constructor?
What is a class in oop?
assume the program must insert 4 elements from the key board and then do the following programs.sequential search(search one of the elements),using insertion sort(sort the element) and using selection sort(sort the element).
What is the purpose of enum?
What is encapsulation?
difference between static and non-static variables?
Where is pseudocode used?
What is this pointer in oop?
2. Give the different notations for the class.\
Why static Function is used in C++?
What are the fields of vtable