Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What is the difference between process & thread??

 
Priti Sharma
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can somebody explain what is the difference between process & thread?? The tutorial on http://java.sun.com says that "Both processes and threads provide an execution environment, but creating a new thread requires fewer resources than creating a new process". What are these resources? Can somebody explain the clear distinction??

Thanks in advance.
 
Prajesh Jagdish Madhavi
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thread is child of a process.
one process can run many threads at a time.
 
Prajesh Jagdish Madhavi
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Priti Sharma
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Prajesh

Got some gyaan from internet & also your explanation made the difference clearer
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic