Why should I use a thread vs. using a process?

前端 未结 8 1646
南旧
南旧 2020-12-12 13:36

Separating different parts of a program into different processes seems (to me) to make a more elegant program than just threading everything. In what scenario would it make

8条回答
  •  無奈伤痛
    2020-12-12 14:38

    Came across this post. Interesting discussion. but I felt one point is missing or indirectly pointed.

    Creating a new process is costly because of all of the data structures that must be allocated and initialized. The process is subdivided into different threads of control to achieve multithreading inside the process.

    Using a thread or a process to achieve the target is based on your program usage requirements and resource utilization.

提交回复
热议问题