Multi-producer multi-consumer queue with optional blocking