Skip to content

RFC Demonstrate new parallel threading API

Stefan Beller git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest5 patches 13 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5FIXUP submodule: implement `module_clone` as a builtin helperbuiltin/submodule--helper.c+7 -40 replies
2/5thread-utils: add a threaded task queuerun-command.c thread-utils.c thread-utils.h+294 -120 replies
3/5submodule: helper to run foreach in parallelbuiltin/submodule--helper.c git-submodule.sh+155 -26 replies
4/5index-pack: Use the new worker poolbuiltin/index-pack.c+32 -397 replies
5/5pack-objects: Use new worker poolbuiltin/pack-objects.c+57 -1180 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 0/5] Demonstrate new parallel threading API

This series build on top of origin/sb/submodule-helper. The first patch is a fixup to the last commit in the target branch to fix a memory leak. The patch is not really part of the series, but as I chose to build on top of that series I can fix it up as we go.

The patch 2 adds a new API to easily use a threaded work pool.

patch 3 adds the command submodule foreach_parallel (completely untested, RFC!) which was the original goal of this series. But oh well, I got tricked by Peff to prove how awesome the new API for parallel threading is, so that's shown off in patches 4 and 5.

Note: Both patch 4 and 5 delete more lines of code than they add, improving readability a lot as you can focus on the actual task and not on the threading stuff.

Any feedback welcome!
Thanks,
Stefan

Stefan Beller (5):
FIXUP submodule: implement module_clone as a builtin helper
thread-utils: add a threaded task queue
submodule: helper to run foreach in parallel
index-pack: Use the new worker pool
pack-objects: Use new worker pool

 builtin/index-pack.c        |  71 ++++++-------
 builtin/pack-objects.c      | 175 +++++++++++---------------------
 builtin/submodule--helper.c | 159 +++++++++++++++++++++++++++--
 git-submodule.sh            |   9 ++
 run-command.c               |  29 +++---
 thread-utils.c              | 237 ++++++++++++++++++++++++++++++++++++++++++++
 thread-utils.h              |  40 ++++++++
 7 files changed, 545 insertions(+), 175 deletions(-)
Signature · 1 line
2.5.0.400.gff86faf