August 2019
Beginner to intermediate
798 pages
17h 2m
English
The GOMAXPROCS environment variable (and Go function) allows you to limit the number of operating system threads that can execute user-level Go code simultaneously. Starting with Go version 1.5, the default value of GOMAXPROCS should be the number of logical cores available in your UNIX machine.
If you decide to assign a value to GOMAXPROCS that is less than the number of the cores in your UNIX machine, you might affect the performance of your program. However, using a GOMAXPROCS value that is larger than the number of the available cores will not necessarily make your Go programs run faster.
You can programmatically discover the value of the GOMAXPROCS environment variable; the relevant code can be found ...
Read now
Unlock full access