Why are threads called lightweight processes?

后端 未结 6 1886
野性不改
野性不改 2020-12-08 19:49

A thread is \"lightweight\" because most of the overhead has already been accomplished through the creation of its process.

I found this in one of the tutorials.

6条回答
  •  伪装坚强ぢ
    2020-12-08 20:38

    Just because the threads share the common memory space. The memory allocated to the main thread will be shared by all other child threads. Whereas in case of Process, the child process are in need to allocate the separate memory space.

提交回复
热议问题