Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
What is the difference between Process and Thread?
What is the difference between Process and Thread?
✍: Guest
A process can contain multiple threads. In most multithreading operating systems, a process gets its own memory address space; a thread doesn't. Threads typically share the heap belonging to their parent process. For instance, a JVM runs in a single process in the host O/S. Threads in the JVM share the heap belonging to that process; that's why several threads may access the same object. Typically, even though they share a common heap, threads have their own stack space. This is how one thread's invocation of a method is kept separate from another's. This is all a gross oversimplification, but it's accurate enough at a high level. Lots of details differ between operating systems. Process vs. Thread A program vs. similar to a sequential program an run on its own vs. Cannot run on its own Unit of allocation vs. Unit of execution Have its own memory space vs. Share with others Each process has one or more threads vs. Each thread belongs to one process Expensive, need to context switch vs. Cheap, can use process memory and may not need to context switch More secure. One process cannot corrupt another process vs. Less secure. A thread can write the memory used by another thread
2012-06-18, 2732👍, 0💬
Popular Posts:
How To Run a JUnit Test Class? A JUnit test class usually contains a number of test methods. You can...
Rachel opened her math book and found that the sum of the facing pages was 245. What pages did she o...
Can we use the constructor, instead of init(), to initialize servlet? Yes , of course you can use th...
What’ is the sequence in which ASP.NET events are processed ? Following is the sequence in which the...
What Is URI? URI (Uniform Resource Identifier) is a superset of URL. URI provides a simple and exten...