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 difference between inheritance and polymorphism?
what is the realstic modeling?
1.what are two type of classe members called? 2.what is data hiding and data encapsulation? 3.how do you make a class member visible aouside its class? 4.what is the default visibility of a class data member? 5.what are the advantages of oop over the structured programing?
Question: Write a program that prints a paycheck. Ask the program user for the name of the employee, the hourly rate, and the number of hours worked. If the number of hours exceeds 40, the employee is paid “time and a half”, that is, 150 percent of the hourly rate on the hours exceeding 40. Be sure to use stepwi se refine ment and break your solution into several functions. Use the int_name function to print the dollar amount of the check.
what is difference between thread and programme.
What is class and object with example?
Out of 4 concepts, which 3 C++ Follow?
Input: enter the value:1234 output: 1 2 3 4 write a program to get above output.....
4 Answers Bally Technologies, IBM, SoftSol,
create a class complex having real and imaginary part of a complex no. as a data member. overload the binary operators(+,- and *) to perform the operations on complex no. objects. overload binary operator using friend function.
2 Answers CTS, Delhi University,
write a program to print * * * * * *
What is difference between class and object with example?
What is public, protected, private?