Anwender95 / go-tour

Automatically exported from code.google.com/p/go-tour
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

There's no synchronization between the 2 invocations of say(), so the output shows 5 "hello" line... #91

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
https://feedback.corp.google.com/#/Report/1047827784

Description:
There's no synchronization between the 2 invocations of say(), so the output 
shows 5 "hello" lines and 4 "world" lines - once the main goroutine ("hello") 
is done, the spawned goroutine ("world") doesn't get a chance to finish.

UI language: en
Detected language: en

Original issue reported on code.google.com by feedback...@gmail.com on 15 Jul 2013 at 9:52

GoogleCodeExporter commented 8 years ago
That's correct, and working as intended.

Original comment by a...@golang.org on 15 Jul 2013 at 11:46

GoogleCodeExporter commented 8 years ago
In that case, do you think maybe it could be made more explicit that this is 
meant to teach us a lesson about this behavior? As it stands, this is 
(presumably) the first thing someone new to Go sees about goroutines, and not 
having a cautionary tale is rather confusing.

Original comment by rez...@google.com on 16 Jul 2013 at 1:48