[PATCH 4/5] index-pack: Use the new worker pool

2015-08-26 Thread Stefan Beller
This demonstrates how the new threading API may be used. There is no change in the workflow, just using the new threading API instead of keeping track of the pthreads ourselves. Signed-off-by: Stefan Beller sbel...@google.com --- builtin/index-pack.c | 23 --- 1 file changed,

[PATCH 4/5] index-pack: Use the new worker pool

2015-08-25 Thread Stefan Beller
By treating each object as its own task the workflow is easier to follow as the function used in the worker threads doesn't need any control logic any more. Signed-off-by: Stefan Beller sbel...@google.com --- builtin/index-pack.c | 71 +++- 1 file

Re: [PATCH 4/5] index-pack: Use the new worker pool

2015-08-25 Thread Jeff King
On Tue, Aug 25, 2015 at 10:28:25AM -0700, Stefan Beller wrote: By treating each object as its own task the workflow is easier to follow as the function used in the worker threads doesn't need any control logic any more. Have you tried running t/perf/p5302 on this? I seem to get a pretty

Re: [PATCH 4/5] index-pack: Use the new worker pool

2015-08-25 Thread Stefan Beller
On Tue, Aug 25, 2015 at 2:12 PM, Junio C Hamano gits...@pobox.com wrote: Stefan Beller sbel...@google.com writes: Not sure I follow there. Original implementation: We have M threads sitting around the table, all of them trying to obtain food from the one bowl on the table and then eating

Re: [PATCH 4/5] index-pack: Use the new worker pool

2015-08-25 Thread Junio C Hamano
Jeff King p...@peff.net writes: On Tue, Aug 25, 2015 at 10:28:25AM -0700, Stefan Beller wrote: By treating each object as its own task the workflow is easier to follow as the function used in the worker threads doesn't need any control logic any more. Have you tried running t/perf/p5302 on

Re: [PATCH 4/5] index-pack: Use the new worker pool

2015-08-25 Thread Stefan Beller
On Tue, Aug 25, 2015 at 12:03 PM, Jeff King p...@peff.net wrote: On Tue, Aug 25, 2015 at 10:28:25AM -0700, Stefan Beller wrote: By treating each object as its own task the workflow is easier to follow as the function used in the worker threads doesn't need any control logic any more. Have

Re: [PATCH 4/5] index-pack: Use the new worker pool

2015-08-25 Thread Stefan Beller
On Tue, Aug 25, 2015 at 1:41 PM, Junio C Hamano gits...@pobox.com wrote: Jeff King p...@peff.net writes: On Tue, Aug 25, 2015 at 10:28:25AM -0700, Stefan Beller wrote: By treating each object as its own task the workflow is easier to follow as the function used in the worker threads doesn't

Re: [PATCH 4/5] index-pack: Use the new worker pool

2015-08-25 Thread Junio C Hamano
Stefan Beller sbel...@google.com writes: Then please don't pick up this patch. This and patch 5 are there to convince Jeff this is a good API, worth being introduced and not over engineered, just solving a problem we're interested in with a minimal amount of code to side track from the actual

Re: [PATCH 4/5] index-pack: Use the new worker pool

2015-08-25 Thread Junio C Hamano
Stefan Beller sbel...@google.com writes: Not sure I follow there. Original implementation: We have M threads sitting around the table, all of them trying to obtain food from the one bowl on the table and then eating it. Once the bowl is all eaten, we can stop. New pattern: One cook puts