go:internals:m
M
Letter “m” – is generally often used as a shorthand to a phrase (current) OS thread
– see: (link).
Strictly related:
M
(struct M
) – is an internal C struct containing some data related to an OS thread – see: pkg/runtime/runtime.h- 'm' (
M m
) – is a thread-local variable of typestruct M
containing data related to the current OS thread – see also: (link), Thread-local storage- NOTE: This variable is of special kind
extern register
, and thus it must be declared in the same way in every C unit of compilation "in all modules and libraries". This is guaranteed if you#include “runtime.h”
.
You can think of it as a “machine”. There are one or more machines, and the scheduler is putting one or more goroutines onto them.
See also
go/internals/m.txt · Last modified: 2020/11/23 17:23 by 127.0.0.1