Python 3.6.5 ドキュメント 検索

phrase: max: clip:
target: order:
Results of 1 - 6 of about 6 for worker (0.019 sec.)
ライブラリと拡張 FAQ — Python 3.6.5 ドキュメント 12375
ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.6.5 ドキュメント » Python よくある質問 ... 例があります: import threading , queue , time # The worker thread gets jobs off the queue. When the queue is ... e will be no more work and exits. # (Realistically workers will run until terminated.) def worker (): print ... ( 'Running worker' ) time . sleep ( 0.1 ) while True : try : arg = q ... ( block = False ) except queue . Empty : print ( 'Worker' , threading . currentThread (), end = ' ' ) print ...
https://man.plustar.jp/python/faq/library.html - [similar]
Logging クックブック — Python 3.6.5 ドキュメント 10638
ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.6.5 ドキュメント » Python HOWTO » Logg ... す: import logging import threading import time def worker ( arg ): while not arg [ 'stop' ]: logging . debug ... ' : False } thread = threading . Thread ( target = worker , args = ( info ,)) thread . start () while True : ... define the logging configurations for listener and workers, the # listener and worker process functions take ... e, you would probably want to do this logic in the worker processes, to avoid # sending events which would b ...
https://man.plustar.jp/python/howto/logging-cookbook.html - [similar]
17.7. queue --- 同期キュークラス — Python 3.6.5 ドキュメント 8810
ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.6.5 ドキュメント » Python 標準ライブラ ... ます。 キューに入れたタスクが完了するのを待つ例: def worker (): while True : item = q . get () if item is None ... queue . Queue () threads = [] for i in range ( num_worker_threads ): t = threading . Thread ( target = worke ... block until all tasks are done q . join () # stop workers for i in range ( num_worker_threads ): q . put ( ...
https://man.plustar.jp/python/library/queue.html - [similar]
17.2. multiprocessing --- プロセスベースの並列処理 — Python 3.6.5 ドキュメント 8298
ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.6.5 ドキュメント » Python 標準ライブラ ... return x * x if __name__ == '__main__' : # start 4 worker processes with Pool ( processes = 4 ) as pool : # ... 1 ) for res in multiple_results ]) # make a single worker sleep for 10 secs res = pool . apply_async ( time ... x ... >>> p . map ( f , [ 1 , 2 , 3 ]) Process PoolWorker-1: Process PoolWorker-2: Process PoolWorker-3: Tra ... tiprocessing.managers import BaseManager >>> class Worker ( Process ): ... def __init__ ( self , q ): ... se ...
https://man.plustar.jp/python/library/multiprocessing.html - [similar]
17.4. concurrent.futures -- 並列タスク実行 — Python 3.6.5 ドキュメント 7421
ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.6.5 ドキュメント » Python 標準ライブラ ... ブジェクトを返します。 with ThreadPoolExecutor ( max_workers = 1 ) as executor : future = executor . submit ( ... ます)。 import shutil with ThreadPoolExecutor ( max_workers = 4 ) as e : e . submit ( shutil . copy , 'src1.t ... on b. return 6 executor = ThreadPoolExecutor ( max_workers = 2 ) a = executor . submit ( wait_on_b ) b = exe ... This will never complete because there is only one worker thread and # it is executing this function. print ...
https://man.plustar.jp/python/library/concurrent.futures.html - [similar]
What's New in Python 2.5 — Python 3.6.5 ドキュメント 7256
ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.6.5 ドキュメント » What's New in Pytho ... processing work on the items have been completed. Worker threads call the other new method, task_done() , t ...
https://man.plustar.jp/python/whatsnew/2.5.html - [similar]
PREV 1 NEXT