package
Version:
v1.2.4
Opens a new window with list of versions in this module.
Published: Feb 14, 2023
License: GPL-2.0, GPL-2.0
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
获取当前的GoroutineID
notice: 应当尽早使用Context替换GOID逻辑
共有三个版本获取GOID(性能比为: 90:3:1)
1.stack: 通过堆栈信息获取
2.go-tls: go 1.17.*版本无法使用go-tls,参考https://github.com/huandu/go-tls,[20211125待修复]
3.getg: 通过汇编代码获取g结构体,再确定goid的offset,用offset获取goid,参考https://github.com/v2pro/plz
Source Files
¶
Click to show internal directories.
Click to hide internal directories.