jobclient(1)

JOBCLIENT(1) General Commands Manual JOBCLIENT(1)

NAME

jobclient — submit a job to GNU Make jobserver

SYNOPSIS

jobclient command [arguments...]

DESCRIPTION

Primarily, this allows shell scripts and other software to submit jobs to a running Make job server, waiting for free slots (usually corresponding to CPUs) to become available before they start.

To submit a job, instead of running your command directly, prepend jobclient to it and run it in the background. The jobclient utility will contact the job server, wait for a free job slot (without using CPU), then launch the command given as its arguments.

ENVIRONMENT

To communicate with jobserver the MAKEFLAGS environment variable must be set.

EXAMPLE

From a shell script, a convenient way to use this would be to first submit all jobs, then use wait without arguments to wait for all children at once, for example:

*$ for f in *; do jobclient process_file $f & done; wait*

Note that every job has a running process even if it is blocked - if the number of jobs is truly large, that might cause trouble in itself. In the future there might be a more shell-friendly way to move the job server communication "up one step" to avoid starting a process when there are no slots available.

SEE ALSO

jobserver(1), jobforce(1), jobcount(1)

/usr/share/doc/jobclient*/README.md

AUTHORS

Simon Brenner (https://social.vivaldi.net/@olsner)

2024-10-30