[PATCH 1/3 v5] src: Add threadlib library for parallel job execution
Mark Wielaard
mark@klomp.org
Tue Aug 5 22:18:44 GMT 2025
Hi Aaron,
On Mon, Aug 04, 2025 at 11:20:52PM -0400, Aaron Merey wrote:
> Add new internal static library libthread.a that provides infrastructure
> for eu-* tools to run functions concurrently using pthreads.
>
> threadlib.c manages per-job threads as well as per-job buffers for stdout
> output. Output for each job is printed to stdout in the order that the
> jobs were added to the job queue. This helps preserve the order of
> output when parallelization is added to an eu-* tool.
>
> threadlib.h declares functions add_job and run_jobs. Jobs are added to
> a threadlib.c internal job queue using add_job. run_jobs concurrently
> executes jobs in parallel.
>
> eu-readelf now links against libthread.a when elfutils is configured
> with --enable-thread-safety.
>
> * src/Makefile.am: libthread.a is compiled and and linked with
> readelf when USE_LOCKS is defined.
> * src/threadlib.c: New file. Manages job creation, concurrent
> execution and output handling.
> * src/threadlib.h: New file. Declares functions add_job and
> run_jobs.
>
> Signed-off-by: Aaron Merey <amerey@redhat.com>
> ---
> v5: No changes.
Still looks good.
Thanks,
Mark
More information about the Elfutils-devel
mailing list