What is Difference between thread and process?
Answer Posted / prashant
Both threads and processes are methods of parallelizing
an application. However, processes are independent execution
units that contain their own state information, use their
own address spaces, and only interact with each other via
interprocess communication mechanisms (generally managed by
the operating system). Applications are typically divided
into processes during the design phase, and a master process
explicitly spawns sub-processes when it makes sense to
logically separate significant application functionality.
Processes, in other words, are an architectural construct.
By contrast, a thread is a coding construct that doesn't
affect the architecture of an application. A single process
might contains multiple threads; all threads within a
process share the same state and same memory space, and can
communicate with each other directly, because they share the
same variables.
Threads typically are spawned for a short-term benefit
that is usually visualized as a serial task, but which
doesn't have to be performed in a linear manner (such as
performing a complex mathematical computation using
parallelism, or initializing a large matrix), and then are
absorbed when no longer required. The scope of a thread is
within a specific code module—which is why we can bolt-on
threading without affecting the broader application.
ref: http://www.ibiblio.org/java/course/week11/02.html
Is This Answer Correct ? | 14 Yes | 3 No |
Post New Answer View All Answers
How do I enable blocked content in internet explorer 11?
Can you list the coffman's conditions that lead to a deadlock?
what is the command to copy windows files (i386) without formatting OS?
What factors determine whether a detection-algorithm must be utilized in a deadlock avoidance system?
What are the three types of operating systems?
How much ram can xp handle?
How do I know if my cpu is overheating?
Is 64bit better than 32bit?
What is fragmentation?
Can you tell what a device is by mac address?
What is 32 bit operating system?
How does thread synchronization occur in a monitor?
How often should I run chkdsk?
What are the essential conditions for a deadlock to occur?
What is deadlock? Explain.