Re: [go-nuts] Worker pool library.

2017-07-30 Thread Bruno Albuquerque
Thanks for the reads up. Funny enough, the race detector did detect several races (which I fixed now) but it did not detect that specific write as a data race. You are right anyway so I fixed that too. On Sun, Jul 30, 2017 at 5:56 AM Jesper Louis Andersen < jesper.louis.ander...@gmail.com> wrote

Re: [go-nuts] Worker pool library.

2017-07-30 Thread Jesper Louis Andersen
Have you tried running your program under the race detector? (go test -race) >From a quick skim of the sources, I think there is a race on the line here https://github.com/brunoga/workerpool/blob/3aec5bae30ec64df86d045730e1a4b8bcc4ae774/workerpool.go#L202 because multiple workers are going to wr

[go-nuts] Worker pool library.

2017-07-28 Thread Bruno Albuquerque
I wrote something up for a personal project and I thought this might be useful to some of you: https://github.com/brunoga/workerpool This tries to simplify executing the same task of a set of items in parallel. It does all the expected stuff from this kind of library and also accepts a context wh