C ++ 11 adds a new thread library <thread> and atomic manipulation library <atomic>, use both libraries can achieve the production - consumer model. The Code
Simple implementation of
the code
Screenshot operating results, it seems no problem temporarily
Because what books have not read, this is my shot in the dark ...