-
Notifications
You must be signed in to change notification settings - Fork 0
Retrieve the runtime ID of the calling thread (go-routine).
License
clickyotomy/goid
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
goid ---- Package "goid" provides a way to retrieve the runtime ID of the current goroutine from its thread local storage (TLS). The function "Get()" retrieves the ID of the calling goroutine. If an architecture-specific assembly routine is defined, it is called, otherwise a fallback (slow) implementation is used to get the same information. It should be noted that the runtime intentionally avoids providing an interface to expose the goroutine ID. From [1]: > Goroutines do not have names; they are just anonymous workers. > They expose no unique identifier, name, or data structure to > the programmer. [1]: https://go.dev/doc/faq#no_goroutine_id
About
Retrieve the runtime ID of the calling thread (go-routine).
Resources
License
Stars
Watchers
Forks
Packages 0
No packages published