Python multiprocessing process vs. standalone Python VM

前端 未结 2 1535
梦如初夏
梦如初夏 2021-02-12 23:49

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条回答
  •  -上瘾入骨i
    2021-02-13 00:27

    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]]).

提交回复
热议问题