Review round 2: change A must not slow builds before any slice exists, so a module given no share sets no GOMAXPROCS. The slice's quota bounds the total; threads only size one step, from the node's share over the module's own capacity (shanks: 24 x 50% / 3 = 4). The share is the node-engine's own config.
15 lines
476 B
Go
15 lines
476 B
Go
package buildstep
|
|
|
|
import (
|
|
"os"
|
|
|
|
"git.novox.be/novox/mesh-sdk/go/buildcpu"
|
|
)
|
|
|
|
// NodeLimits is what one step of a build module is held to (novox/hq ADR 0553 §4): the node's processor share from the
|
|
// word the composer gives the module (buildcpu.ShareWord), divided by the module's own capacity, own, over the machine's
|
|
// processors. Without the word, no thread limit: Threads is 0.
|
|
func NodeLimits(own int) buildcpu.Limits {
|
|
return buildcpu.FromWords(os.Getenv, own)
|
|
}
|