dispatch

dispatch is a small utility program intended to be used to run various other commands, or jobs, in parallel. It will read commands from standard input or from files passed as arguments to its command line. Once the internal list of commands has been built, dispatch will fork a process to run each command by invoking /bin/sh -c followed by the command and its arguments. It will run a certain number of these commands in parallel. The number is determined by the numeric argument of dispatch's num (n) command line option. If this option is omitted, a default value of 2 is used.

dispatch is a reimplementation of disbatcher.pl in C and C++. I did it just because I could. However, it also illustrates a few interesting points regarding implementing a command line utility with C++. For one, the function that actually forks and execs the commands is written in C. It is added to a shared library so that it can be used in other projects.

Version 2.0 of the application has been rewritten to use the boost C++ libraries, Boost.Locale, Boost.IOStreams, and Boost.Program_options.

The dispatch source code is currently available on github.

You can also download distribution tarballs of the versioned releases here.

dispatch is distributed under the terms of the GNU General Public License version 3, or later.

GPL V3 Logo