https://github.com/golang-design/thread
🧵 thead facilities in Go
https://github.com/golang-design/thread
go golang thread
Last synced: 29 days ago
JSON representation
🧵 thead facilities in Go
- Host: GitHub
- URL: https://github.com/golang-design/thread
- Owner: golang-design
- License: mit
- Created: 2021-01-22T09:21:01.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2026-06-06T18:08:05.000Z (29 days ago)
- Last Synced: 2026-06-06T19:14:02.739Z (29 days ago)
- Topics: go, golang, thread
- Language: Go
- Homepage: https://golang.design/x/thread
- Size: 30.3 KB
- Stars: 18
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- go-awesome - thread
- go-awesome - Thread
README
# thread [](https://pkg.go.dev/golang.design/x/thread) [](https://goreportcard.com/report/golang.design/x/thread) 
Package thread provides threading facilities, such as scheduling
calls on a specific thread, local storage, etc.
```go
import "golang.design/x/thread"
```
## Quick Start
```go
th := thread.New()
defer th.Terminate()
// Run on the thread and block until it returns.
th.Call(func() {
// ... runs on the created thread ...
})
// Schedule on the thread without waiting.
th.Go(func() {
// ... runs on the created thread ...
})
// Run on the thread and return a typed value.
n := thread.Eval(th, func() int {
return 42
})
```
## License
MIT © 2020 - 2026 The golang.design Initiative