Added producer and consumer thread structure