goid

package module
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 1, 2024 License: MIT Imports: 4 Imported by: 0

README

goid
----

Package "goid" provides a way to retrieve the runtime ID of
the current goroutine from it's 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

Documentation

Overview

Package goid provides a way to retrieve the runtime ID of the calling goroutine.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get() int64

Get returns the runtime ID of the calling goroutine.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL