Python multiprocessing process vs. standalone Python VM

前端 未结 2 1781
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-12 23:50

Aside from the ease of use of the multiprocessing module when it comes to hooking up processes with communication resources, are there any other differences between

2条回答
  •  终归单人心
    2021-02-13 00:34

    If you ignore any communication issues (i.e., if the separate Python VMs do not communicate among themselves, or communicate only through other mechanisms that are explicitly established), there are no other substantial differences. (I believe multiprocessing, under certain conditions -- Unix-like platforms, in particular -- can use the more efficient fork rather than the fork-exec pair always implied by multiprocessing -- but that's not "substantial" when just a few processes are involved [[IOW, the performance difference on startup will not be material to the performance of the whole system]]).

提交回复
热议问题