Producer/Consumer Pattern

References: https://en.wikipedia.org/wiki/Producer%E2%80%93consumer_problem