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

proposal: Go 2: add routineMap in runtime package And value context support chaining create / config #40515

Closed
enddeadroyal opened this issue Jul 31, 2020 · 3 comments
Labels
FrozenDueToAge Proposal v2 A language change or incompatible library change WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@enddeadroyal
Copy link

Description

1.Add routineMap in runtime package

type RoutineMap struct{}

func NewMap() *RoutineMap
func (rm RoutineMap) Put(v interface{})
func (rm RoutineMap) Get() (interface{}, boolfunc (rm RoutineMap) Remove()
routineMap := runtime.NewMap()
routineMap.Put("test")
v, ok := routineMap.Get()
routineMap.Remove()

2.Value context support chaining create / config

ctx2 := context.WithValue(ctx, key, v).AddValue(key, v).AddValue(key, v)
@gopherbot gopherbot added this to the Proposal milestone Jul 31, 2020
@ianlancetaylor
Copy link
Contributor

This proposal is missing an explanation: why should we do this? Thanks.

@davecheney
Copy link
Contributor

This is a proposal for goroutine local storage hidden inside a global variable. This has been rejected in the past because it is a close analog of thread local storage and shares all the inherent limitations.

@ianlancetaylor ianlancetaylor added WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. v2 A language change or incompatible library change labels Aug 5, 2020
@gopherbot
Copy link

Timed out in state WaitingForInfo. Closing.

(I am just a bot, though. Please speak up if this is a mistake or you have the requested information.)

@golang golang locked and limited conversation to collaborators Sep 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge Proposal v2 A language change or incompatible library change WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

4 participants