Skip to content

Instantly share code, notes, and snippets.

@TakesxiSximada
Created October 26, 2016 02:52
Show Gist options
  • Save TakesxiSximada/064ada1cdac8c816a9830d0643b600b9 to your computer and use it in GitHub Desktop.
Save TakesxiSximada/064ada1cdac8c816a9830d0643b600b9 to your computer and use it in GitHub Desktop.
並行(Concurrent)と並列(Pararel)

並行(Concurrent)と並列(Pararel)

並行(Concurrent)

実行状態を複数保つことができる状態を並行と言います。正し同時に処理を実行することはできません。

* * * * * * * -+
               |
* * * * * * * -+
               | -> [Process]
* * * * * * * -+
               |
* * * * * * * -+

並列(Pararel)

複数の処理を同時に処理できることです。

* * * * * * * -+ -> [Process]

* * * * * * * -+ -> [Process]

* * * * * * * -+ -> [Process]

* * * * * * * -+ -> [Process]

Pythonでよく使われる並行並列処理の分類

並行

  • asyncio (coroutine含む)
  • threading

並列

  • multiprocessing
  • subprocess
  • celery
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment