Implement the master process.