Unix Parallel Process Tree Scheduler

Suppose we have a tree showing process dependency (that is, tree nodes represent processes to be run). A process represented by a child node should not be started before that represented by the parent  node has finished, but the processes represented by sibling nodes can be run in parallel.

This can be implemented in C by using system calls (wait, exec and fork).

But writing such code is a laborious process, as the if then else structure corresponds to the tree structure and quickly gets complex.

The repository linked below implements a .NET front end that takes the tree as the input and outputs the C code that can implement the process scheduler that respects the dependencies given in the process tree.

https://github.com/gvsh/unix_parallel_process_tree

The following is the sample code outputted by the utility that implements such a process tree. In this example, there are 11 processes at level 1 (names 01**) that can be run in parallel, 2 in the next level (names 02**) and 1 in the last level (0301).

The header file used by the C code is also listed below.