Reputation:
During my distributed programming course in Java, my teacher asked this question. He argued that even if it is a commonly used definition it is not totally true.
What are the things that can make a thread to be considered as a heavy-weight process?
Upvotes: 0
Views: 148
Reputation: 533492
heavily/light weight is about how much resources they take and how expensive it is to switch tasks. On Linux a Thread is also treated like a Process with it's own Process Id, however it doesn't use as much resources as you add each one as it shared memory with an existing thread.
A more light weight version of a thread is to use continuations. This can be cheapest with short call stacks as it is an entirely user space implementation.
Threads are more light weight than processes. But...
Upvotes: -3
Reputation: 5308
There is a definite difference between threads and processes - two or more threads share memory space allocated to the process, while the memory space allocated to 2 processes are separate.
What are the things that can make a thread to be considered as a heavy-weight process?
Again, the threads are not the same as processes, so this question still technically is still incorrect.
Upvotes: 0