comparison mercurial/wireproto.py @ 26063:d29859cfcfc2

worker: use multiprocessing to find cpu count The multiprocessing package was added in Python 2.6. The implementation of worker.countcpus() is very similar to multiprocessing.cpu_count(). Ditch our one-off code. multiprocessing does result in a number of imports. However, the lazy importer ensures that we don't import anything until cpu_count() is called. Furthermore, if we are doing something with multiple cores, chances are the time of that operation will dwarf the import time, so module bloat isn't a concern here.
author Gregory Szorc <gregory.szorc@gmail.com>
date Mon, 25 May 2015 13:10:38 -0700
parents 0851678be71b
children d947086d8973
comparison
equal deleted inserted replaced
26062:7154a4a08b96 26063:d29859cfcfc2