General setup of threading for Produce-Consumer