add producer&consumer pattern