InterviewSolution
| 1. |
Differentiate Between A Process And A Thread? |
|
Answer» In simple terms, threads are a part of a process i.e. a SINGLE process in java can spawn multiple threads. Threads and processes in Java are independent paths of execution .A process gets its own memory address SPACE whereas a thread shares the HEAP space BELONGING to the parent process. Every process in java has a unique process identifier, executable code and memory space whereas a thread has its own stack in Java but makes use of the process memory and shares it with other threads. In simple terms, threads are a part of a process i.e. a single process in java can spawn multiple threads. Threads and processes in Java are independent paths of execution .A process gets its own memory address space whereas a thread shares the heap space belonging to the parent process. Every process in java has a unique process identifier, executable code and memory space whereas a thread has its own stack in Java but makes use of the process memory and shares it with other threads. |
|