Piece of code in different languages inspired from examples of the Seven Concurrency Models book by P.Butcher