並び順

ブックマーク数

期間指定

  • から
  • まで

1 - 11 件 / 11件

新着順 人気順

multiprocessingの検索結果1 - 11 件 / 11件

タグ検索の該当結果が少ないため、タイトル検索結果を表示しています。

multiprocessingに関するエントリは11件あります。 pythonPython並列処理 などが関連タグです。 人気エントリには 『Pythonのthreadingとmultiprocessingを完全理解 - Qiita』などがあります。
  • Pythonのthreadingとmultiprocessingを完全理解 - Qiita

    現代の主なOSと言ったら、Mac OS,UNIX,Linux,Windowsなどがあります。これらのOSは「マルチタスク」機能をサポートしています。 マルチタスクとは?と思うかもしれませんが、例えばブラウザーを立ち上げて、音楽聴きながら、Wordでレポートを書くというシチュエーションでは、少なくとも3つのタスクが同時進行しています。そして、表のタスク以外に、裏ではOS関連の様々なタスクがこっそり動いています。 マルチコアのCPUで、マルチタスクが処理できるのは理解しやすいですが、シングルコアのCPUでもマルチタスクが可能です。OSはそれぞれのタスクを交替に実行しています。例えば、タスク1を0.01秒、タスク2を0.01秒、タスク3を0.01秒、タスク1を0.01秒......繰り返して実行していきます。CPUは速いので、ほぼ同時進行のように感じます。この交替実行のことをしばしば「並行処理(

      Pythonのthreadingとmultiprocessingを完全理解 - Qiita
    • Python multiprocessing vs threading vs asyncio - JX通信社エンジニアブログ

      エンジニアの鈴木(泰)です。 今回は、multiprocessingとthreadingとasyncioの違いとはなんだろう?という問に挑戦してみたいと思います。 この問の答えをグーグル先生に聞いてみると、非常にたくさんの情報がヒットします。しかしながら、どの情報も断片的なものばかりで(本記事もそうなのかもしれません)、色々と本を読んだりネットを漁ったりして、情報を補完しなければなりませんでした。 本記事は、僕が調べた限りの情報を集約し、この問に対する結論を1つの記事にまとめたものとなっています。 前提 マルチプロセスとは マルチスレッドとは Pythonにおけるマルチスレッド 本題 マルチプロセス(multiprocessingライブラリ)を利用したほうが良い場合 cpu_sec.py cpu_multiprocessing.py cpu_threading.py cpu_asyncio

        Python multiprocessing vs threading vs asyncio - JX通信社エンジニアブログ
      • その並列処理待った! 「Python 並列処理」でググったあなたに捧ぐasync, threading, multiprocessingのざっくりとした説明 - Qiita

        ※ 本記事ではざっくりとした理解を目的とするため、スレッドとプロセスとコア、非同期処理と並列処理と並行処理の違いについて詳細には取り扱いません。気になる方は下記の記事などをご参考ください。 async スレッド数もコア数も1 だから並列処理じゃなくない? というツッコミは正解です。正確には並列処理ではなくて「非同期処理」といいます。フロントエンドのJavascriptから始めた方にはなじみが深いかもしれませんが、「非同期処理」と「並列処理」は全く違う概念なのでご注意ください。 処理の概要としては、最初に複数のリクエストを投げておいて、レスポンスが全部帰ってくるまで待ち、応答が揃ってから処理を再開します。 これにより、応答に 3~7秒(平均5秒)かかるスクレイピングを100回行う場合、同期処理なら500秒程度かかるところ、asyncを使った非同期処理なら7,8秒程度で実行できます。 (外部と

          その並列処理待った! 「Python 並列処理」でググったあなたに捧ぐasync, threading, multiprocessingのざっくりとした説明 - Qiita
        • Python 3.8 の概要 (その4) - multiprocessing.shared_memory モジュール - atsuoishimoto's diary

          multiprocessing.shared_memory モジュールで、共有メモリを使ってプロセス間でデータを交換できるようになりました。似たような処理は mmap モジュールで実現できましたが、マルチプラットフォームで簡単に利用できるようになります。 Numpyの ndarray オブジェクトを複数のプロセスで共有する場合、まず最初のプロセスで次のように共有メモリを作成します。この例では、共有メモリの名前は "sharedmemory_test1" とします。 import math from multiprocessing import shared_memory import numpy as np SHAPE = (3,3) # 共有メモリ "sharedmemory_test1" を作成 size = math.prod(SHAPE) * numpy.dtype("float"

            Python 3.8 の概要 (その4) - multiprocessing.shared_memory モジュール - atsuoishimoto's diary
          • multiprocessingとグローバル変数

            2019/12/10 01:00 これは DeNA Advent Calendar 2019 の10日目のエントリーです。 9日目は jukey17 さんの Google.Protobuf.Reflectionを利用してC#でProtocol Buffersを汎用的に解析する話 でした。 動作環境など 本エントリに登場するサンプルのコードは次の環境で動作を確認しています。 macOS: 10.15.1 Python: 3.8.0 リポジトリ: https://github.com/tsuyukimakoto/chore_multiprocessing_py38 Python3.8(macOS)のmultiprocessingについて さて、Pythonには GIL(Global Interpreter Lock) という制限があるため、マルチコアを活かすためにマルチスレッドではなくてマルチ

            • [Python] multiprocessing 備忘録

              普段あまり使うことのない multiprocessing について勉強したので備忘録としてまとめておきます。 この記事ではPython3を使います。 なお、基本的に動作確認はLinux/Macでしておりその他OS(特にWindows)での動作確認はできてないのであしからず。 さて、Python(POSIX系)でプロセスを作り出す最も原始的な方法は os.fork() を使うことです。 os.fork は実行プロセスのクローンを作ります。 生成された側のプロセス(子プロセス)では os.fork() から 0 が返却されるため、 この値によって分岐することで子プロセスに任意の動作をさせることができるわけですね。 こんなC言語みたいなことやってると辛くなるので今回は multiprocessing という標準ライブラリを使ってプロセスを操作していきましょう。 ProcessProcessクラス

                [Python] multiprocessing 備忘録
              • GitHub - sybrenjansen/mpire: A Python package for easy multiprocessing, but faster than multiprocessing

                MPIRE, short for MultiProcessing Is Really Easy, is a Python package for multiprocessing. MPIRE is faster in most scenarios, packs more features, and is generally more user-friendly than the default multiprocessing package. It combines the convenient map like functions of multiprocessing.Pool with the benefits of using copy-on-write shared objects of multiprocessing.Process, together with easy-to-

                  GitHub - sybrenjansen/mpire: A Python package for easy multiprocessing, but faster than multiprocessing
                • GitHub - videoflow/videoflow: Python framework that facilitates the quick development of complex video analysis applications and other series-processing based applications in a multiprocessing environment.

                  You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

                    GitHub - videoflow/videoflow: Python framework that facilitates the quick development of complex video analysis applications and other series-processing based applications in a multiprocessing environment.
                  • 10x Faster Parallel Python Without Python Multiprocessing

                    While Python’s multiprocessing library has been used successfully for a wide range of applications, in this blog post, we show that it falls short for several important classes of applications including numerical data processing, stateful computation, and computation with expensive initialization. There are two main reasons: Inefficient handling of numerical data.Missing abstractions for stateful

                      10x Faster Parallel Python Without Python Multiprocessing
                    • 【Python】multiprocessing.Queueを活用した並列処理の最適化(サンプルコード付き) - Sabrou-mal サブロウ丸

                      Pythonでプロセス並列処理を効率的に行うためのツールとして、multiprocessing.Poolは非常に便利です。しかし、下記のような状況では並列化により逆に処理速度が低下することがあります。 data = xxx # 非常に大きなオブジェクト (巨大なリストなど) def func(data, i, j): """並列化したい関数: data、i、jの3つの引数を受け取り、何かの処理を実行する関数""" return data[i] + data[j] # funcの入力 args = [ (data, i, j) for i in range(10) for j in range(10) ] with multiprocessing.Pool as pool: pool.map(func, args) これはなぜかというと、multiprocessing.Poolやmultip

                        【Python】multiprocessing.Queueを活用した並列処理の最適化(サンプルコード付き) - Sabrou-mal サブロウ丸
                      • Why your multiprocessing Pool is stuck (it’s full of sharks!)

                        Why your multiprocessing Pool is stuck (it’s full of sharks!) by Itamar Turner-Trauring Last updated 17 Feb 2023, originally created 04 Sep 2018 You’re using multiprocessing to run some code across multiple processes, and it just—sits there. It’s stuck. You check CPU usage—nothing happening, it’s not doing any work. What’s going on? In many cases you can fix this with a single line of code—skip to

                          Why your multiprocessing Pool is stuck (it’s full of sharks!)
                        1

                        新着記事