最終更新:2021-02-17 (水) 10:43:15 (10d)  

spawn
Top / spawn

概要

  • The parent process starts a fresh python interpreter process. The child process will only inherit those resources necessary to run the process object's run() method. In particular, unnecessary file descriptors and handles from the parent process will not be inherited.
  • Starting a process using this method is rather slow compared to using fork or forkserver?.
  • Unix と Windows で利用可能。Windows と macOS でのデフォルト。

設定方法

  • mp.set_start_method('spawn')

呼び出し

  • spawn_main->_main?->_bootstrap?->Python/multiprocess.Process.run?->_process_worker?

ソースコード

関連