Monday, July 14, 2008

Describe the difference between a Thread and a Process?

PROCESS
A process will execute the threads(set of instructions), which may contain multiple threads sometimes.
THREAD
It contains a group of instructions that a processor has to do.

Process is a execution of a program and program contain set of instructions but thread is a single sequence stream within the process.thread is sometime called lightweight process. single thread alows a os to perform singler task ata time similarities between process and threads are:
1) share cpu.
2) sequential execution
3) create child
4) if one thread is blocked then the next will be start to run like process.

dissimilarities:
1) threads are not independent like process.
2) all threads can access every address in the task unlike process.
3) threads are design to assist onr another and process might or not might be assisted on one another.

ref: http://wiki.answers.com

No comments: