go-eden / routine Goto Github PK
View Code? Open in Web Editor NEWProvides some convenient API, includes Goid(), GetG() and LocalStorage, which is a goroutine's local storage, just like ThreadLocal in other languages.
License: MIT License
Provides some convenient API, includes Goid(), GetG() and LocalStorage, which is a goroutine's local storage, just like ThreadLocal in other languages.
License: MIT License
看了最新版本源码,其中 goid 获取方式基本参考了我的 gohack 项目。希望作者能声明下来源和地址,谢谢!
大佬您好,获取 goid 的降级有什么条件吗?
提了一个pr,使用go的地方加了recover的保护,要不一个panic就可能导致整个进程退出
The owner @sisyphsu cannot login GitHub, so this library couldn't be maintained until he find the way to login...
目前是不是不支持go1.21版本,我尝试了一下报错
github.com/go-eden/routine/internal/g.getg0: relocation target type.runtime.g not defined
go version go1.20.4 darwin/amd64
# github.com/go-eden/routine/internal/g.test
github.com/go-eden/routine/internal/g.getg0: relocation target type.runtime.g not defined
FAIL github.com/go-eden/routine/internal/g [build failed]
if runtimeReadgstatus(gp) == gDead || runtimeIsSystemGoroutine(gp, false) {
continue
}
在系统调用/cgo/新建g的时候, g的状态也是gDead, 是否不应该在这里过滤掉gDead状态的g
因为这里的g状态虽然是dead,但等一会还是会恢复成runnable
如cgo调用
这个会导致所有 new 的 storage 的 key 是 0 ?导致最后实际 storage 最后共享了一套 value?
1.18下好像不能用了,请问开发者有支持1.18的计划吗
如题,不太清楚golang struct g的labels具体的作用是什么?
Env:mac Darwin Kernel Version 20.4.0 arm64
Problem :
Compare p equals to nil is necessary?
pr: #5
请问呢32位机器有实现计划吗
Currently the NewLocalStorage doesn't support multiple instance, because the " type storage struct {
}" is empty, need put one field is the storage struct.
使用的时候报错如下:
goroutine 1 [running, locked to thread]:
runtime.throw({0x10226d3d6, 0x5})
/usr/local/go/src/runtime/panic.go:1198 +0x54 fp=0x14000068c60 sp=0x14000068c30 pc=0x10220db94
runtime.sigpanic()
/usr/local/go/src/runtime/signal_unix.go:742 +0x1e4 fp=0x14000068ca0 sp=0x14000068c60 pc=0x102223e04
github.com/go-eden/routine.getGoidByNative()
/Users/markma/go/pkg/mod/github.com/go-eden/[email protected]/routine_goid.go:75 +0x48 fp=0x14000068cd0 sp=0x14000068cb0 pc=0x10226c1f8
github.com/go-eden/routine.Goid()
/Users/markma/go/pkg/mod/github.com/go-eden/[email protected]/routine_api.go:69 +0x20 fp=0x14000068cf0 sp=0x14000068cd0 pc=0x10226bec0
github.com/go-eden/routine.loadCurrentStore()
/Users/markma/go/pkg/mod/github.com/go-eden/[email protected]/routine_storage.go:77 +0x20 fp=0x14000068dd0 sp=0x14000068cf0 pc=0x10226c720
github.com/go-eden/routine.(*storage).Clear(...)
/Users/markma/go/pkg/mod/github.com/go-eden/[email protected]/routine_storage.go:70
github.com/go-eden/routine.NewLocalStorage()
/Users/markma/go/pkg/mod/github.com/go-eden/[email protected]/routine_api.go:60 +0x24 fp=0x14000068df0 sp=0x14000068dd0 pc=0x10226be24
main.init()
/Users/markma/GolandProjects/awesomeProject/main.go:8 +0x20 fp=0x14000068e10 sp=0x14000068df0 pc=0x10226ce20
runtime.doInit(0x102305aa0)
/usr/local/go/src/runtime/proc.go:6498 +0x138 fp=0x14000068f70 sp=0x14000068e10 pc=0x10221edb8
runtime.main()
/usr/local/go/src/runtime/proc.go:238 +0x22c fp=0x14000068fd0 sp=0x14000068f70 pc=0x10221032c
runtime.goexit()
/usr/local/go/src/runtime/asm_arm64.s:1133 +0x4 fp=0x14000068fd0 sp=0x14000068fd0 pc=0x10223b924
go env 如下
GO111MODULE="on"
GOARCH="arm64"
GOBIN="/usr/local/go/bin"
GOCACHE="/Users/markma/Library/Caches/go-build"
GOENV="/Users/markma/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="arm64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/markma/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/markma/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_arm64"
GOVCS=""
GOVERSION="go1.17.1"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/markma/GolandProjects/awesomeProject/go.mod"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.