Home » Java programming language

Difference between Process and Thread in java

Learn: What is Process and Thread in java? What are the differences between Process and Thread in java?
Submitted by Preeti Jain, on February 06, 2018

1) Process in java

  • Process is a part of operating System.
  • Process is a heavy weight.
  • Allocate space for processes are separated.
  • Every process are individual It means at the same time one process is downloading a file from internet resource and second process is user listening music in the background and third process user is working in a ms-office.
  • There is no co-relation between the processes. Multiple processes can run simultaneously.
  • Every process required the resource to execute a program.
  • A process has a virtual address space, executable code, open handles to system objects (i.e. in simple terms it allocates spaces for code, data, stack, registers etc).

2) Thread in java

  • Thread is also a part of operating System.
  • Thread is a light weight process.
  • Allocate space for threads are not separated it means it is sub part of processes.
  • Every Thread is not an individual It means Thread is independent part of the program (In other terms we can Thread is a sub part of the same program).
  • There is co-relation between the threads.(In simple terms we have a large projects and in their several modules so what we can do with the help of thread concepts we can divide a large project into threads and thread will divided in a team to work on but basically we are trying to say it is a part of the project ).
  • Thread is recommended to improve performance and reduce throughput.
  • Thread is an entity within process that can be scheduled for execution.
  • Threads also share its virtual address space and system resources.
  • There are several responsibilities of threads like Exception handling, scheduling priority, Thread Local storage etc.

Was this page helpful? YES NO

Are you a blogger? Join our Blogging forum.

Comments and Discussions

We are using Google to publish ads on our website; Google has its own privacy policies. They may save log, cookies on your system. Google may also collect information of your system like IP address, region, city, country. For more details please go through the Google’s privacy policy.