For the OP: A thought to share on the general topic: Go is pioneering a sufficiently different model of concurrent computation that it may not make much sense to ask for or seek equivalencies with classic thread/process models.
This says nothing against the standard model, nor against the “missing” services; it is a note to encourage design in Go along with coding in Go, instead of design in C/C++/Java/POSIX/... and a best-effort realization in Go. By way of analogy, I’ve long been involved in boat design and construction. We always use a pair Furuno or Simrad RADAR antennas, one of long range and one short, to optimize object detection/clutter rejection and as a redundancy safety factor. However, when sailing on a HobeeCat, i’ve never looked for nor missed the Radar or any other instruments of navigation. A HobieCat is just such a different idea of sailing that *all* the normal mechanisms have no place. There is no “where do I stow the anchor” or “where do I control the RAM signal lights.” There are whole chapters of the USCG instructions (ColRegs) where the thing discussed is not on a HobeeCat. That does not make such boats inadequate; it makes them fun. If you can stop thinking of concurrency in Go as a small group of exquisitely instrumented machines and instead imagine a swarm of ants, you’ll find new and interesting ways to solve problems. They often work even better, and are also more fun. On Wed, Jun 19, 2019 at 9:37 AM Robert Engels <[email protected]> wrote: > Side-managed thread/execution context has been around since the concept of > a thread. It is highly useful, and is more robust and secure than a Context > object passed among methods. > > If Go had any concept of a "secure runtime" it would be essential, but it > doesn't, so you make do with what you have. > > > -----Original Message----- > From: [email protected] > Sent: Jun 19, 2019 11:08 AM > To: golang-nuts > Subject: [go-nuts] Re: is there a goroutine scope global veriable ? > > This has been discussed many times before. Searching "local storage" on > this group brings up many discussions, including: > > https://groups.google.com/d/topic/golang-nuts/Nt0hVV_nqHE/discussion > https://groups.google.com/d/topic/golang-nuts/_Vv7Bzn8yH4/discussion > https://groups.google.com/d/topic/golang-nuts/zuWWBHKn6iw/discussion > > My take is that GLS could be genuinely useful in a few cases, but would > undoubtedly lead to abuse in most cases. In the vast majority of > situations, what you really want to track, or log, is the specific work > being done, not actually which goroutine it happens to be running on. For > example, tracking a specific request, etc. My advice is to pass around a > context, or some other identifying information about the specific work > being done. At first this will seem tedious and annoying, but you will > likely get used to it. > > > On Tuesday, June 18, 2019 at 10:59:09 PM UTC-4, hui zhang wrote: >> >> is there a goroutine scope global veriable ? >> like fork a variable from main ? >> > -- > You received this message because you are subscribed to the Google Groups > "golang-nuts" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/golang-nuts/53512dd1-8c24-460d-9bf5-646ea1e95d0f%40googlegroups.com > <https://groups.google.com/d/msgid/golang-nuts/53512dd1-8c24-460d-9bf5-646ea1e95d0f%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > > > > > -- > You received this message because you are subscribed to the Google Groups > "golang-nuts" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/golang-nuts/1187971360.3926.1560962237733%40wamui-berry.atl.sa.earthlink.net > <https://groups.google.com/d/msgid/golang-nuts/1187971360.3926.1560962237733%40wamui-berry.atl.sa.earthlink.net?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- *Michael T. [email protected] <[email protected]>* -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CALoEmQy_p7hs%3DxrWGFx65r7xb63wGi_dg6aL6PRFfG7%2BwFP7-Q%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
