Use producer/consumer pattern