2020-04-01から1ヶ月間の記事一覧
import multiprocessing as mp import multiprocessing.sharedctypes as mpshared def worker(idx: int, queue: mp.Queue, shared_counter): while True: if not queue.get(): break shared_counter[idx] += 1 def main(): NUM_WORKERS = 64 shared_counter …