自动检测CPU数目,启动合适数目的进程。

pull/84/head
Linker Lin 12 years ago
parent 8e9b4bbe72
commit 2ceb981da0

@ -3,7 +3,8 @@ import sys,time
import sys
sys.path.append("../../")
import jieba
jieba.enable_parallel(4)
import multiprocessing
jieba.enable_parallel(multiprocessing.cpu_count())
url = sys.argv[1]
content = open(url,"rb").read()

Loading…
Cancel
Save