2010-12-03 04:34:57 +00:00
|
|
|
// Copyright 2009 The Go Authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
package runtime
|
|
|
|
|
|
|
|
// GOMAXPROCS sets the maximum number of CPUs that can be executing
|
2016-07-22 18:15:38 +00:00
|
|
|
// simultaneously and returns the previous setting. If n < 1, it does not
|
2010-12-03 04:34:57 +00:00
|
|
|
// change the current setting.
|
2012-01-25 20:56:26 +00:00
|
|
|
// The number of logical CPUs on the local machine can be queried with NumCPU.
|
2010-12-03 04:34:57 +00:00
|
|
|
// This call will go away when the scheduler improves.
|
|
|
|
func GOMAXPROCS(n int) int
|
|
|
|
|
2016-02-03 21:58:02 +00:00
|
|
|
// NumCPU returns the number of logical CPUs usable by the current process.
|
|
|
|
//
|
|
|
|
// The set of available CPUs is checked by querying the operating system
|
|
|
|
// at process startup. Changes to operating system CPU allocation after
|
|
|
|
// process startup are not reflected.
|
2012-02-01 19:26:59 +00:00
|
|
|
func NumCPU() int
|
|
|
|
|
2012-03-02 20:01:37 +00:00
|
|
|
// NumCgoCall returns the number of cgo calls made by the current process.
|
|
|
|
func NumCgoCall() int64
|
2010-12-03 04:34:57 +00:00
|
|
|
|
2012-03-02 20:01:37 +00:00
|
|
|
// NumGoroutine returns the number of goroutines that currently exist.
|
|
|
|
func NumGoroutine() int
|
2010-12-03 04:34:57 +00:00
|
|
|
|
2012-11-29 18:11:17 +00:00
|
|
|
// Get field tracking information. Only fields with a tag go:"track"
|
|
|
|
// are tracked. This function will add every such field that is
|
|
|
|
// referenced to the map. The keys in the map will be
|
|
|
|
// PkgPath.Name.FieldName. The value will be true for each field
|
|
|
|
// added.
|
|
|
|
func Fieldtrack(map[string]bool)
|