OLD | NEW |
1 # Copyright 2013 The Swarming Authors. All rights reserved. | 1 # Copyright 2013 The LUCI Authors. All rights reserved. |
2 # Use of this source code is governed under the Apache License, Version 2.0 that | 2 # Use of this source code is governed by the Apache v2.0 license that can be |
3 # can be found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 """Classes and functions related to threading.""" | 5 """Classes and functions related to threading.""" |
6 | 6 |
7 import functools | 7 import functools |
8 import inspect | 8 import inspect |
9 import logging | 9 import logging |
10 import os | 10 import os |
11 import Queue | 11 import Queue |
12 import sys | 12 import sys |
13 import threading | 13 import threading |
(...skipping 789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
803 # Multiprocessing | 803 # Multiprocessing |
804 import multiprocessing | 804 import multiprocessing |
805 return multiprocessing.cpu_count() | 805 return multiprocessing.cpu_count() |
806 except: # pylint: disable=W0702 | 806 except: # pylint: disable=W0702 |
807 try: | 807 try: |
808 # Mac OS 10.6 | 808 # Mac OS 10.6 |
809 return int(os.sysconf('SC_NPROCESSORS_ONLN')) # pylint: disable=E1101 | 809 return int(os.sysconf('SC_NPROCESSORS_ONLN')) # pylint: disable=E1101 |
810 except: | 810 except: |
811 # Some of the windows builders seem to get here. | 811 # Some of the windows builders seem to get here. |
812 return 4 | 812 return 4 |
OLD | NEW |