Skip to content

Commit

Permalink
Update cpu.go
Browse files Browse the repository at this point in the history
  • Loading branch information
kolinfluence authored Mar 19, 2024
1 parent 48aa01b commit 30110dd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions thread/cpu.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@ var (

func init() {
NumCPU = uint16(runtime.NumCPU())
pflag.Uint16VarP(&CPUThread, "CPUThread", "t", 0, "prefork child id")

//Parse it in main
// pflag.Parse() //parse at cxcputhread as it's very important, preparsing with another "flag" module before calling cxcputhread
}

func DefineFlags() {
pflag.Uint16VarP(&CPUThread, "CPUThread", "t", 0, "prefork child id")
}

//cpu core 0 == 1
//cpu core 1 == 2
func SetCPUAffinity(cpu uint16) error {
Expand Down

0 comments on commit 30110dd

Please sign in to comment.