Separating producing and consuming from the queue