1. Application and Common Code

Consider an exhaustive search (e.g. Xcoin mining, password cracking, etc.) performed by instances of a worker function checking subsets of an integer search space.

Implementations: serial vs. parallel; Communication: shared memory vs. pipe

Common code, common.c:

#include <stdio.h>
#include <unistd.h>

#define N 4 // number of workers

typedef struct
{
  int i; // instance number
  unsigned int start, size; // search space: start ... start+size-1
  //...
}
Data;

Data D[N];