Results of 1 - 10 of about 16 for ThreadPoolExecutor (0.009 sec.)
- concurrent.futures --- 並列タスク実行 15093
- concurrent.futures --- 並列タスク実行 Added in version 3.2. ソースコード: Lib/concurrent/futures/thread.py 、 Lib/concurrent/futures/process.py および Lib/concurrent/futures/interpreter.py concurrent.futures モジュールは、呼び出し可能オブジ
...ェクトを非同期に実行するための高水準インターフェースを提供します。 非同期実行には、 ThreadPoolExecutor または InterpreterPoolExecutor によるスレッド、あるいは ProcessPoolExecutor による別プロセスを使えます。 いずれも、抽象クラ...*kwargs) として実行するようにスケジュールし、呼び出し可能オブジェクトの実行を表現する Future オブジェクトを返します。 with ThreadPoolExecutor ( max_workers = 1 ) as executor : future = executor . submit ( pow , 323 , 1235 ) print ( future . result ()) map ( fn , *...非常に長いイテラブルでは、 chunksize に大きな値を使うと、デフォルトのサイズ 1 に比べて性能が大幅に向上する場合があります。 ThreadPoolExecutor と InterpreterPoolExecutor では、 chunksize は効果がありません。 バージョン 3.5 で変更: chunksize 引数が追加されました。 バ... - https://man.mtool.work/python/3.14/library/concurrent.futures.html
- 並行実行 9773
- 並行実行 この章で説明するモジュールは、コードの並行実行をサポートします。 適切なツールは、実行するタスク (CPU バウンドか I/O バウンドか) と、好みの開発スタイル (イベント駆動の協調的マルチタスクかプリエンプティブマルチタスクか) によって異なり
...プロセス間で直接アクセス可能な共有メモリ concurrent パッケージ concurrent.futures --- 並列タスク実行 Executor オブジェクト ThreadPoolExecutor ThreadPoolExecutor の例 InterpreterPoolExecutor ProcessPoolExecutor ProcessPoolExecutor の例 Future オブジェクト モジュール... - https://man.mtool.work/python/3.14/library/concurrency.html
- イベントループ 9062
- イベントループ ソースコード: Lib/asyncio/events.py , Lib/asyncio/base_events.py まえがき イベントループは全ての asyncio アプリケーションの中核をなす存在です。イベントループは非同期タスクやコールバックを実行し、ネットワーク I/O を処理し、サブ
...ed in version 3.6. async loop. shutdown_default_executor ( timeout = None ) デフォルトの Executor の終了をスケジュールし、 ThreadPoolExecutor のすべてのスレッドの終了を待ちます。 このメソッドを呼び出した後で loop.run_in_executor() によりデフォルトの Executor を使う...は loop.set_default_executor() で設定できます。 設定しなければ、 run_in_executor() が必要になった時点で concurrent.futures.ThreadPoolExecutor を初期化して使います。 以下はプログラム例です: import asyncio import concurrent.futures def blocking_io (): # ログ記録など...ing_io ) print ( 'default thread pool' , result ) # 2. 自分で作成したスレッドプールで実行する: with concurrent . futures . ThreadPoolExecutor () as pool : result = await loop . run_in_executor ( pool , blocking_io ) print ( 'custom thread pool' , result ) # 3. 自分... - https://man.mtool.work/python/3.14/library/asyncio-eventloop.html
- What's New In Python 3.2 8335
- What's New In Python 3.2 著者 : Raymond Hettinger この記事では Python 3.1 と比較した Python 3.2 の新機能を説明します。 Python 3.2 は 2011 年 2 月 20 日にリリースされました。 主な変更点をいくつか取り上げ、例を示します。 すべての詳細については
...が実行を終えた際にリソースが自動的に解放されることを保障出来ます。 以下はファイルコピーを行う 4 つの並列スレッドを実行する、 ThreadPoolExecutor の単純な使用例です: import concurrent.futures , shutil with concurrent . futures . ThreadPoolExecutor ( max_workers = 4 )...t ( shutil . copy , 'src3.txt' , 'dest4.txt' ) 参考 PEP 3148 - Futures -- 計算の非同期な実行 PEP written by Brian Quinlan. ThreadPoolExecutor の例 はスレッド並列でウェブページを取得する実例コードです。 ProcessPoolExecutor の実例を 並列で素数計算するコード例 として... - https://man.mtool.work/python/3.14/whatsnew/3.2.html
- asyncio での開発 8196
- asyncio での開発 非同期プログラミングは、従来の「逐次的」なプログラミングとは異なります。 このページはよくある間違いや落とし穴を列挙し、それらを回避する方法を説明します。 デバッグモード asyncio はデフォルトで本運用モードで実行されます。いっ
...行うには、イベントループはメインスレッド内で実行しなければなりません。 loop.run_in_executor() メソッドを concurrent.futures.ThreadPoolExecutor または InterpreterPoolExecutor と組み合わせると、イベントループの OS スレッドをブロックせずに、別の OS スレッドでブロッキン... - https://man.mtool.work/python/3.14/library/asyncio-dev.html
- What's New In Python 3.8 8196
- What's New In Python 3.8 編集者 : Raymond Hettinger この記事では Python 3.7 と比較した Python 3.8 の新機能を解説します。 Python 3.8 は 2019 年 10 月 14 日にリリースされました。 詳しくは 変更履歴 を参照してください。 概要 -- リリースハイライ
...on 3.9 で削除されます。 (Contributed by Serhiy Storchaka in bpo-29209 .) loop.set_default_executor() に concurrent.futures.ThreadPoolExecutor のインスタンス以外を渡すことが非推奨になり、Python 3.9 では禁止されます。 (Contributed by Elvis Pranskevichus in bpo-34075...) 、 trace.Trace.runfunc() 、 curses.wrapper() の func 。 unittest.TestCase.addCleanup() の function 。 concurrent.futures.ThreadPoolExecutor と concurrent.futures.ProcessPoolExecutor の submit() メソッドの fn 。 contextlib.ExitStack.callback() 、 contextlib.Async... - https://man.mtool.work/python/3.14/whatsnew/3.8.html
- What's New In Python 3.9 8196
- What's New In Python 3.9 編集者 : Łukasz Langa この記事では Python 3.8 と比較した Python 3.9 の新機能を解説します。 Python 3.9 は 2020 年 10 月 5 日にリリースされました。 詳しくは 変更履歴 を参照してください。 参考 PEP 596 - Python 3.9 リリ
...い コルーチン shutdown_default_executor() が追加されました。 デフォルトのエグゼキューターのシャットダウンをスケジュールし、 ThreadPoolExecutor の終了処理が完了するまで待ちます。 asyncio.run() も、この新しい コルーチン を使うよう更新されました。 (Contributed by Kyle...をすべてキャンセルし、完了を待たずにエグゼキューターをシャットダウンします。 (Contributed by Kyle Stanley in bpo-39349 .) ThreadPoolExecutor と ProcessPoolExecutor がデーモンスレッドを使わなくなりました。 これによりサブインタープリタとの互換性と、終了処理の予測し... - https://man.mtool.work/python/3.14/whatsnew/3.9.html
- Python ドキュメントの目次 8057
- Python ドキュメントの目次 What's New in Python What's new in Python 3.14 概要 -- リリースハイライト 新しい機能 PEP 649 と PEP 749 : アノテーションの遅延評価 PEP 734 : 複数インタープリタ機能が標準ライブラリに追加 PEP 750 : テンプレート文字列
...プロセス間で直接アクセス可能な共有メモリ concurrent パッケージ concurrent.futures --- 並列タスク実行 Executor オブジェクト ThreadPoolExecutor ThreadPoolExecutor の例 InterpreterPoolExecutor ProcessPoolExecutor ProcessPoolExecutor の例 Future オブジェクト モジュール... - https://man.mtool.work/python/3.14/contents.html
- ライブラリと拡張 FAQ 8057
- ライブラリと拡張 FAQ ライブラリ一般の質問 作業 X を行うためのモジュールやアプリケーションを探すにはどうしますか? ライブラリリファンレス から関係がありそうな標準ライブラリモジュールがあるかどうか調べてください。 (標準ライブラリに何があるかが
...。 たくさんのワーカースレッドに作業を割り振るにはどうしますか? 最も簡単な方法は、新しい concurrent.futures モジュール、特に ThreadPoolExecutor クラスを使うことです。 もしくは、実行アルゴリズムを上手にコントロールしたい場合は、自身の手でロジックを書くこともできます。... - https://man.mtool.work/python/3.14/faq/library.html
- What's New In Python 3.7 8057
- What's New In Python 3.7 編集者 : Elvis Pranskevichus < elvis @ magic . io > この記事では Python 3.6 と比較した Python 3.7 の新機能を解説します。Python 3.7 は2018年6月27日にリリースされました。全詳細については 変更履歴 をご覧ください。 概要
...引数で無効化方式を指定できます。 (Contributed by Benjamin Peterson in bpo-31650 .) concurrent.futures ProcessPoolExecutor と ThreadPoolExecutor が新しいコンストラクタ引数 initializer と initargs をサポートするようになりました。 (Contributed by Antoine Pitrou in bpo-...は、内部のマッピングの順序を保持するようになりました。 (Contributed by Raymond Hettinger in bpo-32792 .) concurrent.futures.ThreadPoolExecutor と concurrent.futures.ProcessPoolExecutor の submit() メソッドは、インタープリタの終了処理中に呼ばれると RuntimeError を送... - https://man.mtool.work/python/3.14/whatsnew/3.7.html