2
21kviews
What resources are used when a thread is created ? How do they differ from those when a process is created?
1 Answer
3
5.8kviews
  • Thread is a part of the process and it is called a lightweight process.
  • A process must have at least one thread. Therefore, creating a process means creating the process and creating a thread.
  • Since a thread is a part of the process, no additional resources are used when a thread is created, instead, it shares the memory space of the process from which this particular thread has been created.
  • Creation of a thread is cheap. Hence, it is called a lightweight process.
  • Whereas process creation is quite expensive because it has to set up a completely new virtual memory space for the process with its own address space.
  • Process creation takes a lot of CPU time and is called a heavyweight process.

Therefore, no resource is used when a thread is created whereas a new memory space is created while creating a process.

Please log in to add an answer.