home of xjobs utility
reads job descriptions line by line and executes them in
parallel. It limits the number of parallel executing jobs and starts new
jobs when jobs finish. Therefore, it combines the arguments from every
input line with the utility and arguments given on the command line. If
no utility is given as an argument to xjobs
, then the first
argument on every job line will be used as utility. To execute utility
xjobs searches the directories given in the PATH environment variable
and uses the first file found in these directories.
xjobs is most useful on multi-processor/core machines when one
needs to execute several time consuming command several that could
possibly be run in parallel. With xjobs this can be achieved
easily, and it is possible to limit the load of the machine to a useful
value. It works similar to xargs, but starts several processes
simultaneously and gives only one line of arguments to each utility
is written in C and uses the POSIX API. There is nothing
special about it, but if one searches a small and useful example for lex
integration, its source code may be worth a look.
is stable. If you encounter a bug or need an enhancement,
please feel free to contact me.
Comment on GNU xargs vs. xjobs
Yes, GNU's xargs has an option -P that allow parallelizing jobs. But you
must tell xargs how many arguments to pass to each job, as it doesn't
make a difference between a space and a newline charakter. In
consequence each job issued by xargs must have the same number of
arguments, whereas xjobs can handle different jobs with different
commands and different number of arguments.
Additionally, xjobs support I/O redirection, which makes some
applications possible that cannot be done with GNU's xargs. xjobs also
determines the number of processors automatically, whereas xargs must be
told how many processes to start. Finally, non-GNU xargs (e.g. Solaris'
and DEC/Compaq/HP Alpha's) don't have the option -P.
Try to do the following with GNU's xargs with some files having blanks
in their name:
ls -1 *.mp3 | sed 's/\(.*\)\.mp3/"\1.mp3" > "\1.wav"/' | xjobs -- mpg123 -s
If you aren't convinced yet, just compare the output of unziping
multiple zip files in parallel with xjobs and GNU xargs. xjobs won't
intermix the output of unzip like xargs. Instead it will present the
output of each unzip separated clearly from the other jobs.
OpenCSW Packages for Solaris
If you encounter any problems with the packages, please report the issue.
Version 20140125 md5:6a90ab1e998241171c78e4e25d38665c (current release)
Version 20120412 md5:6a90ab1e998241171c78e4e25d38665c
Version 20110730 md5:4a6547455adae84dc72a1519f516f86f
Version 20110724 md5:16fa95b8bcbfdfd1698f1fec5b4e9d2c
Version 20100915 md5:df9310c060a4b8c467e240495ad495b8
Version 20100311 md5:28c89f1d944f0d44b2014475a0763027
Take a look at my blog entry, concerning this release.
Version 20060408 (initial release)
GNU GPL 2
This software has been successfully tested under the following operatingsystems:
- Solaris (primary target)