From 2ae5b8bd2f211cb6e21c3dff6c18c4841bf0d757 Mon Sep 17 00:00:00 2001 From: Johannes Findeisen Date: Sat, 7 Dec 2013 18:59:36 +0100 Subject: [PATCH] just playing around with a process pool. do not use this commits code! --- bin/linspector | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bin/linspector b/bin/linspector index 3ac1d42..ca474de 100755 --- a/bin/linspector +++ b/bin/linspector @@ -29,6 +29,8 @@ import logging.handlers import os import os.path as path import sys +import multiprocessing +from multiprocessing import Pool from linspector.config.parser import FullConfigParser from linspector.core.interface import LinspectorInterface @@ -89,8 +91,12 @@ def parse_args(): return parser.parse_args() +pool = Pool(processes=16) +print 'cpu_count() = %d\n' % multiprocessing.cpu_count() + + def handle_job(job): - job.handle_call() + result = pool.apply_async(job.handle_call()) def main():