![]() ![]() 32 // We need to balance between keeping enough running worker threads to utilize 33 // available hardware parallelism and parking excessive running worker threads 34 // to conserve CPU resources and power. ![]() 30 31 // Worker thread parking/unparking. ![]() 26 // M must have an associated P to execute Go code, however it can be 27 // blocked or in a syscall w/o an associated P. 25 // P - processor, a resource that is required to execute Go code. 21 // 22 // The main concepts are: 23 // G - goroutine. 4 5 package runtimeġ5 16 // set using cmd/go/internal/modload.ModInfoProg 17 var modinfo stringġ8 19 // Goroutine scheduler 20 // The scheduler's job is to distribute ready-to-run goroutines over worker threads. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. Src/ runtime/ proc.go 1 // Copyright 2014 The Go Authors.
0 Comments
Leave a Reply. |