March 2020
Intermediate to advanced
406 pages
8h 39m
English
This struct is labeled P for processor. The P struct represents a logical processor. This is set by GOMAXPROCS (which should be equivalent to the number of cores available after Go version 1.5). P maintains a queue of all of the goroutines (defined by the G struct). When you invoke a new goroutine using the Go executor, this new goroutine gets inserted into P's queue. If P doesn't have an associated M struct, it will allocate a new M. Some notable P struct parameters are the following:
Read now
Unlock full access