Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runtime.NumGoRoutine lies #4507

Open
dgryski opened this issue Oct 7, 2024 · 1 comment
Open

runtime.NumGoRoutine lies #4507

dgryski opened this issue Oct 7, 2024 · 1 comment

Comments

@dgryski
Copy link
Member

dgryski commented Oct 7, 2024

We should fix https://github.com/tinygo-org/tinygo/blob/release/src/runtime/debug.go#L17

@aykevl
Copy link
Member

aykevl commented Oct 7, 2024

The runtime currently does not track which goroutines exist. So this information is not currently available.

This actually has an interesting benefit: goroutines are just plain old data structures to the garbage collector. If two goroutines are deadlocked with each other for example, they should get garbage collected like any other object on the heap. Because the GC doesn't know these are goroutines, it can't lower a count of goroutines for example.

(This could be fixable in the precise GC, by using special values for the "layout" value).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants