What is the difference between processes and threads?

Technology CommunityCategory: JavaWhat is the difference between processes and threads?
VietMX Staff asked 3 years ago

The main difference between them is that

  • Process is a program which is executing some code and
  • Thread is an independent path of execution in the process.

A process can have more than one thread for doing independent task e.g. a thread for reading data from disk, a thread for processing that data and another thread for sending that data over the network.