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


Please Help Members By Posting Answers For Below Questions

Which event determines that all the controls are completely loaded into memory?

573


Explain the basic concepts and hierarchy of memory?

543


When an input file is opened, what are the possible errors that may occur?

567


What is trcd timing?

547


Why is 64 bit better?

511






What resources are used when a thread created? How do they differ from those when a process is created?

517


One starts counting from 0 to max and the other stars from max to 0. Which one executes fast.

538


Which is the fastest operating system?

558


What's the difference between 32 and 64 bit?

514


How do you create a directory?

550


Do 32 bit programs run faster on 64bit?

543


How can the FCFS scheduling be made better?

701


Which one you will use to implement critical section?

1730


What does the 400 mhz signify in a ram specification?

536


Discuss some of the reasons for implementing process migration ?

2558