producer/consumer design pattern