KZKY memo

自分用メモ.

multiprocessing

Comparison between Multiprocessing and Multithreading in Python

Comparison between Multiprocessing and Multithreading in Python See github.com

Python: TCP Server

基本 Cのsokcet programmingとほとんど同じ Server側 create socket bind socket to (host, port) socket listens with qsize socket accepts connection socket recv msg from a client socket send msg to a client Client側 create socket socket connect…

Python: Manager

基本 何ができるか Manager は別のプロセス間で共有されるデータの作成方法を提供します。マネージャオブジェクトは 共有オブジェクト を管理するサーバプロセスを制御します。他のプロセスはプロキシ経由で共有オブジェクトへアクセスすることができます。 …

PythonにおけるShared Memory

前提 pythonはGILの影響でmulti thread programmingでcpu-bound jobが早くならない. なので,multiprocessingを使うしかない.CPythonのmultiprocessingはforkなので,unixならcopy-on-write.なので,globで定義したデータなら,Read-onlyに限り,特段気に…

python multiprocessing

Python multiprocessingでWokerPoolを作る.multiprocessing.Poolはタスクの実行にグローバル関数しか渡せないの不便だと思う. WorkerPool Worker Task の3クラスを作ってJava ConcurrentのExecuterServiceのようにマルチプロセッシングしたい. そうした…