go-eden / routine

Provides some convenient API, includes Goid(), GetG() and LocalStorage, which is a goroutine's local storage, just like ThreadLocal in other languages.
MIT License
114 stars 20 forks source link

垃圾回收使用struct g的labels作为生命周期,生产环境是安全的吗? #13

Closed funbytes closed 2 years ago

funbytes commented 2 years ago

如题,不太清楚golang struct g的labels具体的作用是什么?

sisyphsu commented 2 years ago

具体用途可以看下runtime源码,labels的内部类型为map<string, string>,我理解它主要用于类似debug的环境,正常生产环境中并没有使用