Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(425)

Side by Side Diff: src/pkg/co/sysconf_darwin.go

Issue 4850045: co: new package
Patch Set: diff -r d499fb951a9e https://go.googlecode.com/hg/ Created 12 years, 7 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/pkg/co/sysconf.go ('k') | src/pkg/co/sysconf_freebsd.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2011 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
4
5 package co
6
7 import (
8 "exec"
9 "os"
10 )
11
12 func sysInitOS() {
13 cmd := exec.Command("sysctl", "hw.ncpu", "machdep.cpu.core_count", "hw.p ackages", "machdep.cpu.cache.linesize")
14 info, err := cmd.Output()
15 if err != nil {
16 print("co.SysConf: failed to execute sysctl (", err, ")\n")
17 return
18 }
19 sysConf[ConfThreadCount] = sysParam(info, "hw.ncpu")
20 sysConf[ConfCoreCount] = sysParam(info, "machdep.cpu.core_count")
21 sysConf[ConfProcessorCount] = sysParam(info, "hw.packages")
22 sysConf[ConfNumaNodeCount] = sysConf[ConfProcessorCount]
23 sysConf[ConfCacheLineSize] = sysParam(info, "machdep.cpu.cache.linesize" )
24 }
OLDNEW
« no previous file with comments | « src/pkg/co/sysconf.go ('k') | src/pkg/co/sysconf_freebsd.go » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b