add modern producer consumer mechanism