what is the GOMAXPROCS default value

后端 未结 3 1407
夕颜
夕颜 2021-02-01 02:01

Is it guaranteed that GOMAXPROCS is set to 1 when the environment variable of the same name is not set?

This code shows the value:

package main

import (         


        
3条回答
  •  一生所求
    2021-02-01 02:13

    As Go 1.5 Release Notes says

    By default, Go programs run with GOMAXPROCS set to the number of cores available; in prior releases it defaulted to 1.

    So starting from Go 1.5, the default value should be the number of cores.

提交回复
热议问题