Re: [go-nuts] defer go [was: A few go 2 suggestions]

2017-10-10 Thread Michael Jones
(part 2) ...sorry, I should have said: "f() will complete its evaluation before g() is runnable, it g() runs at all." "g() will become runnable before evaluation of f() is started" "f() will evaluate completely and then g() will evaluate completely before func() returns" On Tue, Oct 10, 2017

Re: [go-nuts] defer go [was: A few go 2 suggestions]

2017-10-10 Thread Michael Jones
First... go func() { f() go g() }() is tremendously different than: go func() { go g() f() }() and neither is equivalent to : go func() { f() g() } () ...and on the order of evaluation and visibility and weak memory

[go-nuts] defer go [was: A few go 2 suggestions]

2017-10-10 Thread Juliusz Chroboczek
> 1. "defer go" extend defers to work on goroutine exit with mechanism just > like defer, but if we say "defer go f()" > instead of "defer f()" then we run on goroutine exit. Very big gains for > scaling here IMHO. If I read the language specification right, goroutines have no identity: a