I just learn multiple threading programming, but the question here is a very basic concept need to be clarified first of all.
As I searched from internet, what i understand is Heavyweight is regarding to “process”, and Lightweight maps to “thread”. However, why process is heavyweight? because of non-sharing memory or something else?
“Heavyweight” concurrency is where each of the concurrent executors is expensive to start and/or has large overheads.
“Lightweight” concurrency is where each of the concurrent executors is cheap to start and/or has small overheads.
Processes are generally more expensive to manage for the OS than threads, since each process needs an independent address space and various management structures, whereas threads within a process share these structures.
Consequently, processes are considered heavyweight, whereas threads are lightweight.
However, in some contexts, threads are considered heavyweight, and the “lightweight” concurrency facility is some kind of “task”. In these contexts, the runtime will typically execute these tasks on a pool of threads, suspending them when they block, and reusing the threads for other tasks.