Made the registry started depend on semaphore rather than console input.

Added some comments to make it more similar to the non distributed
assignment on which it is based