.Net Framework Interview Questions and Answers
<< Previous Question Next Question >>
 Question: 4986 Page Views: 

Describe the difference between a Thread and a Process?



Posted By: Avi Date: 30 October 2009 07:29:42 AM
 Answer:

A process is a unit of execution which has its own data regarding the source, has its own memory space for addresses, and can interact with other processes only through communication systems that the operating system runs specifically for processes to communicate with each other. A process can have sub-processes as well.

A Thread is a small piece of the code within the single process. A Process may consist of numerous threads. These threads within the same process share the same memory space, process instruction, data segment,open file descriptor, etc. Also, they do not need communication systems run by the OS, they can communicate with each other directly. Thread has its own set of register including program counter,stack pointer.


Posted By: eTechPlanet


Date: 30 October 2009 07:29:42 AM

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.


Posted By: Johndecruse


Date: 17 February 2010 12:52:26 AM
Post a better Answer if you have
 
(Will show your Gravatar icon)  
  Country flag

Loading
Enter the text as shown in the image ON7mnN
Related Questions
.Net Framework : What is XmlDocument class?

What is XmlDocument class?

This class represents XML document. It is-memory tree representation of XML document.
Category: .Net Framework Date: 10/14/2010 7:05:49 AM
.Net Framework : What is MEF?

What is MEF?

MEF – Managed Extensibility framework is set of libraries that simplifies creation of extensible app....
Category: .Net Framework Date: 10/14/2010 6:55:49 AM
.Net Framework : What is jagged array?

What is jagged array?

It’s array of arrays. It’s not the same as multidimensional array.
Category: .Net Framework Date: 10/14/2010 4:08:48 AM
.Net Framework : What type of pipes does the .Net framework supports?

What type of pipes does the .Net framework supports?

Anonymous pipes, named pipes
Category: .Net Framework Date: 10/14/2010 2:24:48 AM
.Net Framework : How do you overload a method?

How do you overload a method?

By giving new method the same name as existing one and changing the list of parameters (adding, remo....
Category: .Net Framework Date: 10/14/2010 1:41:49 AM