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

Comments

@enddeadroyal
Copy link

@enddeadroyal enddeadroyal commented Jul 31, 2020

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
@gopherbot gopherbot added the Proposal label Jul 31, 2020
@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Jul 31, 2020

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

@davecheney
Copy link
Contributor

@davecheney davecheney commented Aug 5, 2020

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.

@gopherbot
Copy link

@gopherbot gopherbot commented Sep 5, 2020

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.)

@gopherbot gopherbot closed this Sep 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.