• Post Reply Bookmark Topic Watch Topic
  • New Topic

Thread and Process?  RSS feed

 
Lee Xu
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the differece in formal sentence?
Thanks
 
marilyn murphy
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could say that a thread is a lightweight process. You can have many threads in one process.
 
Rashmi Tambe
Ranch Hand
Posts: 418
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To understand the basic difference between thread and a process u have to consider various points:
1. Each process has -
A. Register context - value of CPU register when the process is executing.
B. Data context - The code that the process is executing.
C. Stack Context - Various values of function call returns and local variables etc.
Now, no. of threads can constitute one process. So all of them share Data Context. So Every thread has just the stack and register context.
2. Instead of multithreading, if u use multi - processing, the interprocess communication is a bit expensive and complex as compared to interthread communication.
3.Therefore a thread is a light-weigth process.
Hope this helps
Rashmi
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!