Re: [PATCH 07/15] run-command API: make "jobs" parameter an "unsigned int"
- From
Calvin Wan <calvinwan@google.com>
- Date
- Oct 4, 2022, 17:41 UTC
- Message-ID
- <CAFySSZCk3t6OE=zP=86aUNPTuEnvs0LfroH+UcTek7fG_jJ9xQ@mail.gmail.com>
- In-Reply-To
- <patch-07.15-a9810aaa852-20220930T111343Z-avarab@gmail.com>
> The rename the "n" variable added in c553c72eed6 (run-command: add an > asynchronous parallel child processor, 2015-12-15) to "jobs", and > change the type to an "unsigned int". As we'll see in a subsequent > commit we do pass "0" here, but never "jobs < 0".
Show 6 quoted lines
> - pp->max_processes = n;
> + pp->max_processes = jobs;
>
> - trace_printf("run_processes_parallel: preparing to run up to %d tasks", n);
> + trace_printf("run_processes_parallel: preparing to run up to %d tasks",
> + jobs);Should we normalize what we call processes/jobs/tasks? They all seem to mean the same thing. I'm leaning towards processes since the function name itself is run_processes_parallel.
> - * Runs up to n processes at the same time. Whenever a process can be > + * Runs up to 'jobs' processes at the same time. Whenever a process can be
Also should "jobs" be changed to "max_jobs" or whatever normalized name we call it? The comment here can then be changed to: "Runs up to 'max_processes' at the same time."