per page, with , order by , clip by
Results of 1 - 10 of about 82 for process (0.009 sec.)
multiprocessing --- プロセスベースの並列処理 15175
multiprocessing --- プロセスベースの並列処理 ソースコード: Lib/multiprocessing/ 利用可能な環境 : not Android, not iOS, not WASI. このモジュールは モバイルプラットフォーム と WebAssemblyプラットフォーム をサポートしません。 はじめに multiprocess ... cessing は、 threading モジュールに似た API でプロセスを生成できるパッケージです。 multiprocessing パッケージは、ローカルとリモートの両方で並行処理を提供し、スレッドの代わりにサブプロセスを使うことで グローバルインター ... プリタロック を実質的に回避します。 そのため、 multiprocessing モジュールを使うと、マシンに搭載された複数のプロセッサーを十分に活用できます。 POSIX と Windows の両方で動作します。 mu ... ltiprocessing モジュールは Pool オブジェクトも提供します。 これは、入力データをプロセス間に分配し、複数の入力値に対する関数の実行を並 ...
https://man.mtool.work/python/3.14/library/multiprocessing.html
サブプロセス 12709
サブプロセス ソースコード: Lib/asyncio/subprocess.py , Lib/asyncio/base_subprocess.py このセクションはサブプロセスの生成と管理を行う高水準の async/await asyncio API について説明します。 以下は、 asyncio モジュールがどのようにシェルコマンドを ... 実行し、結果を取得できるかを示す例です: import asyncio async def run ( cmd ): proc = await asyncio . create_subprocess_shell ( cmd , stdout = asyncio . subprocess . PIPE , stderr = asyncio . subprocess . PIPE ) stdout , stderr = await proc . ... eep 1; echo "hello"' )) asyncio . run ( main ()) 使用例 節も参照してください。 サブプロセスの生成 async asyncio. create_subprocess_exec ( program , * args , stdin = None , stdout = None , stderr = None , limit = 65536 , ** kwds ) サブプロセスを作成します ... 。 limit 引数は、 stdout と stderr をラップする StreamReader のバッファの上限を設定します ( stdout と stderr 引数に subprocess.PIPE を渡した場合)。 Process のインスタンスを返します。 他のパラメータについては loop.subprocess_exec() を参照してください ...
https://man.mtool.work/python/3.14/library/asyncio-subprocess.html
Logging クックブック 11851
Logging クックブック Author : Vinay Sajip <vinay_sajip at red-dove dot com> このページは、過去に有用であるとされていた、logging に関連するいくつものレシピを含んでいます。チュートリアルやリファレンス情報へのリンクについては その他のリソース ... g call to the underlying logger, after adding contextual information from this adapter instance. """ msg , kwargs = self . process ( msg , kwargs ) self . logger . debug ( msg , * args , ** kwargs ) LoggerAdapter の process() メソッドがコンテキスト情報を ... す。それ以外のメソッドが必要なとき、たとえばコンテキスト情報をメッセージの前や後ろにつなげたい場合には、 LoggerAdapter から process() を望むようにオーバライドしたサブクラスを作ることが必要なだけです。次に挙げるのはこのクラスを使った例で、コンストラクタで ... ts the passed in dict-like object to have a 'connid' key, whose value in brackets is prepended to the log message. """ def process ( self , msg , kwargs ): return '[ %s ] %s ' % ( self . extra [ 'connid' ], msg ), kwargs これを次のように使うことができま ...
https://man.mtool.work/python/3.14/howto/logging-cookbook.html
multiprocessing.shared_memory --- プロセス間で直接アクセス可能な共有メモリ 8309
multiprocessing.shared_memory --- プロセス間で直接アクセス可能な共有メモリ ソースコード Lib/multiprocessing/shared_memory.py Added in version 3.8. このモジュールは、マルチコアもしくは対称型マルチプロセッサ(SMP) を持つマシン上で実行される、ひ ... うための SharedMemory クラスを提供します。共有メモリのライフサイクル管理、とりわけ複数のプロセスにわたる場合のために、 multiprocessing.managers モジュールでは BaseManager のサブクラス SharedMemoryManager も提供されます。 このモジュールでの共有メモリは「P ... データのシリアライズ、復元、コピーが必要ですが、メモリを介して直接共有すると性能が大きく向上する場合があります。 class multiprocessing.shared_memory. SharedMemory ( name = None , create = False , size = 0 , * , track = True ) 新しい共有メモリブロックを作 ... ーストラッカーは、そのメモリにアクセスする他のプロセスがすべて後始末せずに終了しても、共有メモリを適切に後始末します。 multiprocessing の機能を使って共通の祖先から作成された Python プロセスは、1 つのリソーストラッカーを共有し、共有メモリセグメントの寿命を ...
https://man.mtool.work/python/3.14/library/multiprocessing.shared_memory.html
pty --- 擬似端末ユーティリティ 7873
pty --- 擬似端末ユーティリティ ソースコード: Lib/pty.py pty モジュールは、別のプロセスを起動してその制御端末をプログラムから読み書きする、擬似端末の操作を定義します。 利用可能な環境 : Unix. 擬似端末の扱いはプラットフォームに大きく依存します ... ich they should read from, and they should always return a byte string. In order to force spawn to return before the child process exits an empty byte array should be returned to signal end of file. どちらの関数も、デフォルトの実装は呼び出しごとに最大 1 ... ill not be called after that. If stdin_read signals EOF the controlling terminal can no longer communicate with the parent process OR the child process. Unless the child process will quit without any input, spawn will then loop forever. If master_read s ...
https://man.mtool.work/python/3.14/library/pty.html
subprocess --- サブプロセス管理 7737
subprocess --- サブプロセス管理 ソースコード: Lib/subprocess.py subprocess モジュールでは、新しいプロセスを生成し、その標準入力、標準出力、標準エラー出力のパイプに接続して、終了コードを取得できます。 このモジュールは、次のような古いモジュー ... ルや関数を置き換えるためのものです。 os . system os . spawn * subprocess モジュールでこれらのモジュールや関数を置き換える方法は、後の節で説明します。 参考 PEP 324 -- subprocess モジュールを提案し ... droid, not iOS, not WASI. このモジュールは モバイルプラットフォーム と WebAssemblyプラットフォーム をサポートしません。 subprocess モジュールの使用 サブプロセスの起動には、 run() 関数で対応できる用途であればこの関数を使うことを推奨します。 より高度な用途 ... では、下層の Popen インターフェースを直接使用できます。 subprocess. run ( args , * , stdin = None , input = None , stdout = None , stderr = None , capture_output = False , shell = False , c ...
https://man.mtool.work/python/3.14/library/subprocess.html
DTrace と SystemTap で CPython を測定する 7669
DTrace と SystemTap で CPython を測定する author : David Malcolm author : Łukasz Langa Dtrace と SystemTap はモニタリングツールで、コンピュータシステムのプロセスが何をしているかを調べる方法を提供します。 どちらもドメイン固有言語 (domain-spe ... 必要があります。 例えば、この SystemTap スクリプトは Python の呼び出し/返却 (call/return) 階層を表示するのに使えます: probe process("python").mark("function__entry") { filename = user_string($arg1); funcname = user_string($arg2); lineno = $arg3; printf(" ... %s => %s in %s:%d\\n", thread_indent(1), funcname, filename, lineno); } probe process("python").mark("function__return") { filename = user_string($arg1); funcname = user_string($arg2); lineno = $arg3; printf( ... 有ライブラリに含まれるため、プローブのドットで区切ったパスにもそれを反映する必要があります。 例えば、上の例の次の行は: probe process("python").mark("function__entry") { 次のように書き換えます: probe process("python").library("libpython3.6dm.so.1.0").mark( ...
https://man.mtool.work/python/3.14/howto/instrumentation.html
concurrent.futures --- 並列タスク実行 7519
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 による別プロセスを使えます。 いずれも、抽象クラス Executor で定義された同じインターフェースを実装しています。 ... 待ち時間に制限はありません。 もし fn の呼び出しが例外を送出した場合、その例外はイテレータから値を受け取る時に送出されます。 ProcessPoolExecutor を使う場合、このメソッドは iterables を複数のチャンクに分割し、それぞれを別々のタスクとしてプールに投入します。 ... を掛けたものになります。これは、 ThreadPoolExecutor は CPU の処理ではなく I/O をオーバーラップするのによく使用されるため、 ProcessPoolExecutor のワーカーの数よりもこのワーカーの数を増やすべきであるという想定に基づいています。 バージョン 3.6 で変更: thre ...
https://man.mtool.work/python/3.14/library/concurrent.futures.html
リモートデバッグのアタッチプロトコル 7451
リモートデバッグのアタッチプロトコル このプロトコルを使うと、外部ツールから実行中の CPython プロセスにアタッチし、Python コードをリモートで実行できます。 別の Python プロセスへのアタッチには、プラットフォームによって追加の権限や設定が必要な ... リタのリスト、スレッド状態、デバッガーを支援するフィールドなどの内部データにアクセスできます。 To work with a remote Python process, a debugger must first find the memory address of the PyRuntime structure in the target process. This address can't be har ... と同じユーザーであるか root 権限を持つなど、適切な権限が必要です。 もう一つは、プロセス間でより効率的にメモリをコピーできる process_vm_readv() システムコールを使う方法です。 ptrace の PTRACE_PEEKTEXT 操作でもメモリを読めますが、一度に 1 ワードしか読めず、 ... ースする側とされる側のプロセス間で複数回のコンテキスト切り替えが必要なため、はるかに低速です。 For parsing ELF sections, the process involves reading and interpreting the ELF file format structures from the binary file on disk. The ELF header contains a p ...
https://man.mtool.work/python/3.14/howto/remote_debugging.html
スレッドセーフ性の保証 7369
スレッドセーフ性の保証 このページでは、Python のフリースレッドビルドにおける組み込み型のスレッドセーフ性の保証を説明します。 ここで説明する保証は、 GIL を無効にして Python を使う場合 (フリースレッドモード) に適用されます。 GIL が有効な場合、 ... クではない: 確認してから実行 if lst : item = lst . pop () # スレッドセーフではない: 変更中のイテレーション for item in lst : process ( item ) # ほかのスレッドが lst を変更する可能性がある スレッド間で list インスタンスを共有する場合は、外部での同期を検討し ... 実行 (TOCTOU) if key in d : del d [ key ] # スレッドセーフではない: 変更中のイテレーション for key , value in d . items (): process ( key ) # ほかのスレッドが d を変更する可能性がある 確認から使用までの間に状態が変わる問題 (TOCTOU: time-of-check to time- ... は、コピーをイテレートしてください。 # 安全にイテレートするためにコピーを作成する for key , value in d . copy () . items (): process ( key ) スレッド間で dict インスタンスを共有する場合は、外部での同期を検討してください。 set オブジェクトのスレッドセーフ性 ...
https://man.mtool.work/python/3.14/builtins/threadsafety.html
PREV 1 2 3 4 5 6 7 8 9 NEXT