mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-04 11:07:46 +00:00
runtime: implement NumCPU for -scheduler=threads
For the threads scheduler, it makes sense to have NumCPU available. For all other schedulers, the number of available CPUs is practically limited to one by the scheduler (even though the system might have more CPUs).
This commit is contained in:
committed by
Ron Evans
parent
25b83920b6
commit
02c5c4213c
@@ -1,14 +1,5 @@
|
||||
package runtime
|
||||
|
||||
// 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.
|
||||
func NumCPU() int {
|
||||
return 1
|
||||
}
|
||||
|
||||
// Stub for NumCgoCall, does not return the real value
|
||||
func NumCgoCall() int {
|
||||
return 0
|
||||
|
||||
Reference in New Issue
Block a user