1.1 --- a/pprocess.py Sun Jun 08 19:44:10 2008 +0000
1.2 +++ b/pprocess.py Fri Aug 01 19:59:38 2008 +0200
1.3 @@ -818,7 +818,7 @@
1.4
1.5 _cpuinfo_fields = "physical id", "core id"
1.6
1.7 -def get_number_of_cores():
1.8 +def _get_number_of_cores():
1.9
1.10 """
1.11 Return the number of distinct, genuine processor cores. If the platform is
1.12 @@ -853,6 +853,19 @@
1.13 except OSError:
1.14 return None
1.15
1.16 +def _get_number_of_cores_solaris():
1.17 +
1.18 + """
1.19 + Return the number of cores for OpenSolaris 2008.05 and possibly other
1.20 + editions of Solaris.
1.21 + """
1.22 +
1.23 + f = os.popen("psrinfo -p")
1.24 + try:
1.25 + return int(f.read().strip())
1.26 + finally:
1.27 + f.close()
1.28 +
1.29 # Low-level functions.
1.30
1.31 def create_socketpair():
1.32 @@ -899,8 +912,10 @@
1.33
1.34 if platform.system() == "SunOS":
1.35 create = create_pipes
1.36 + get_number_of_cores = _get_number_of_cores_solaris
1.37 else:
1.38 create = create_socketpair
1.39 + get_number_of_cores = _get_number_of_cores
1.40
1.41 def create_persistent(address):
1.42