Code skeleton according to wikipedia page on producer consumer problem