Re: [go-nuts] Re: Golang concurrency design question

2016-07-14 Thread Dan Kortschak
Contexts grow. Yes, that was the OP's context. net is broader and so my comment needed qualification. :) On Thu, 2016-07-14 at 00:27 -0700, sphilip...@gmail.com wrote: > The exact context here is "concurrent directory traversal program" :) > > четверг, 14 июля 2016 г., 9:07:32 UTC+3 пользова

Re: [go-nuts] Re: Golang concurrency design question

2016-07-14 Thread sphilippov
The exact context here is "concurrent directory traversal program" :) четверг, 14 июля 2016 г., 9:07:32 UTC+3 пользователь kortschak написал: > > Mostly. As always, the exact context is significant. > > On Thu, 2016-07-14 at 15:34 +0930, Dan Kortschak wrote: > > Yes. This is how it's done in the

Re: [go-nuts] Re: Golang concurrency design question

2016-07-13 Thread Dan Kortschak
On Wed, 2016-07-13 at 23:13 -0700, Richard Todd wrote: > I don't think there is a right answer here, without a context. > Yeah. The net package is instructive here. There are cases where a goroutine is spawned with the acquireThread call (this blocks on a chan operation to limit thread use) just

Re: [go-nuts] Re: Golang concurrency design question

2016-07-13 Thread Richard Todd
To give the other side of the argument: If you have something useful to do between the loop and the wg.Wait(), that would be a reason to consider just launching them all. Also, I guess in theory the runtime's scheduler might do a better job if it knows about the total amount of work that's waiti

Re: [go-nuts] Re: Golang concurrency design question

2016-07-13 Thread Dan Kortschak
Mostly. As always, the exact context is significant. On Thu, 2016-07-14 at 15:34 +0930, Dan Kortschak wrote: > Yes. This is how it's done in the net package. > > On Wed, 2016-07-13 at 23:01 -0700, sphilip...@gmail.com wrote: > > Block then spawn: https://play.golang.org/p/fUZ2RKr-u0 -- You rec

Re: [go-nuts] Re: Golang concurrency design question

2016-07-13 Thread Dan Kortschak
Yes. This is how it's done in the net package. On Wed, 2016-07-13 at 23:01 -0700, sphilip...@gmail.com wrote: > Block then spawn: https://play.golang.org/p/fUZ2RKr-u0 -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this grou

[go-nuts] Re: Golang concurrency design question

2016-07-13 Thread sphilippov
Block then spawn: https://play.golang.org/p/fUZ2RKr-u0 -- 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 golang-nuts+unsubscr...@googlegroups.com. For more options,