tag:blogger.com,1999:blog-8110657754519829885.post3848488526159333806..comments2023-07-10T01:54:55.230-07:00Comments on GoLang Tutorials: GoroutinesSathish VJhttp://www.blogger.com/profile/15718521031646368740noreply@blogger.comBlogger6125tag:blogger.com,1999:blog-8110657754519829885.post-68244294106384179442015-01-06T08:36:47.589-08:002015-01-06T08:36:47.589-08:00I second this. The method was made to be used wit...I second this. The method was made to be used with the time units (time.Second, time.Millisecond, etc.). Using simple constants can be unclear.Christophernoreply@blogger.comtag:blogger.com,1999:blog-8110657754519829885.post-87678446235307724212013-08-04T19:00:15.776-07:002013-08-04T19:00:15.776-07:00The order of printing depends on when the goroutin...The order of printing depends on when the goroutine 'wakes up' and is given access to the CPU. When high jump wakes at the 3 second mark, it is given access to the CPU and prints the message. Long jump wakes up after 6, prints its message. Finally sprint wakes up after 10, and prints its message. Jashhttps://www.blogger.com/profile/16381614310218706491noreply@blogger.comtag:blogger.com,1999:blog-8110657754519829885.post-52487836678740886122012-09-19T15:41:41.168-07:002012-09-19T15:41:41.168-07:00why there is no parallel execution on GAE ?why there is no parallel execution on GAE ?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8110657754519829885.post-57741708241599041572012-07-03T05:44:56.063-07:002012-07-03T05:44:56.063-07:00Even better is:
time.Sleep(time.Duration(timeInSec...Even better is:<br />time.Sleep(time.Duration(timeInSecs) * time.Second)Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8110657754519829885.post-58348702846866618252012-06-13T23:18:40.098-07:002012-06-13T23:18:40.098-07:00The add2Numbers code won't work (only the firs...The add2Numbers code won't work (only the first add2Numbers call will be made) because func main () ends and all scheduled goroutines are killed. You should put a time.Sleep(1) statement after the go add2Numbers statement.Anirbanhttps://www.blogger.com/profile/00285530012534090130noreply@blogger.comtag:blogger.com,1999:blog-8110657754519829885.post-64860975612515365042012-05-06T23:24:05.965-07:002012-05-06T23:24:05.965-07:00With Go ver. 1, the line
time.Sleep(timeInSecs...With Go ver. 1, the line<br /> time.Sleep(timeInSecs * 1e9 )<br />should be <br /> time.Sleep(time.Duration(timeInSecs * 1e9))Anonymousnoreply@blogger.com