![]() |
|
| vb / asp.net Interview / Technical Questions Kindly solve an many as questions you can. It will sharpen your skills and those solutions will help others too. |
![]() |
| LinkBack | Thread Tools | Display Modes |
| | #1 (permalink) |
| Moderator Join Date: Jul 2006
Posts: 2,191
Thanks: 5
Thanked 505 Times in 324 Posts
Rep Power: 73 | Describe the difference between a Thread and a Process? Describe the difference between a Thread and a Process?
__________________ Kiran |
| | |
| | #2 (permalink) |
| Junior Member Join Date: Mar 2009 Age: 29
Posts: 9
Thanks: 0
Thanked 2 Times in 2 Posts
Rep Power: 1 | 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). |
| | |
![]() |
| Tags |
| difference , process , thread |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Need .Net Interview Questions | vidyasagarkumar | VB / ASP.NET Technologies | 6 | 06-09-07 12:37 AM |
| thread - join() | anitha.s | JAVA Technologies | 2 | 29-01-07 11:42 AM |
| J2EE - What is difference between runnable and thread ? why we use static class | preethisingh | Java Interview / Technical Questions | 0 | 23-01-07 02:38 PM |
| J2EE - What are the various ways of creating a thread. What is difference between them? | preethisingh | Java Interview / Technical Questions | 0 | 23-01-07 02:21 PM |
| java JSP | naga | JAVA Technologies | 4 | 21-08-06 04:03 PM |
| More Interview Questions Here... |