GO进程调度相关源码学习
启动流程
procresize流程
malloc.go
Memory allocator
sizeclass.go
span按大小区分的 类型定义
mbitmap.go
type and heap bitmaps
mgc.go
Garbage collector (GC)
mcache.go
Per-thread (in Go, per-P) cache for small objects.
central.go
Central free lists
mheap.go
Page heap
type mspan struct
//堆结构
struct mheap {
}
mstats.go
Memory statistics
mfixalloc.go
固定尺寸的堆对象空闲列表分配器,用来管理分配器的存储
runtimt2.go
G status,
sudog represents a g in a wait list, such as for sending/receiving on a channel
type g struct
type m struct
type p struct
type schedt struct
1 初始化内存
入口在 runtime/proc.go
schedinit() -> mallocinit()
参考
- http://blog.csdn.net/zhonglinzhang/article/details/74626412
- https://zhuanlan.zhihu.com/p/27807169
- http://www.cnblogs.com/zkweb/p/7880099.html
- TLS: http://www.cppblog.com/Tim/archive/2012/07/04/181018.html
- http://blog.jobbole.com/100212/
- https://studygolang.com/articles/11904 - 垃圾回收