Discover Packages
github.com/smallnest/goroutine
package
module
Version:
v1.1.0
Opens a new window with list of versions in this module.
Published: Dec 31, 2023
License: BSD-3-Clause
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
README
¶
goroutine identification
Package goroutine provides functions that will return the runtime's
ID number for the calling goroutine or its creator.
The implementation is derived from Laevus Dexter's comment in Gophers' Slack
#darkarts, https://gophers.slack.com/archives/C1C1YSQBT/p1593885226448300
post which linked to this playground snippet https://play.golang.org/p/CSOp9wyzydP .
The code here is an exercise in minimalism, doing as little as possible by
deferring nearly all of the logic to runtime functions co-opted via
//go:linkname
comments.
Expand ▾
Collapse ▴
Documentation
¶
ID returns the runtime ID of the calling goroutine.
PID returns the "P" ID of the calling goroutine.
ParentID returns the runtime ID of goroutine that created the calling
goroutine.
type Link struct {
Parent, Child int64
}
Link is a goroutine parent-child relationship.
All returns all the known goroutine parent-child relationships.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.