Producer-Consumer solution using a double buffer instead of a queue.