Below is a small and easy puzzle on multi-threading, ideal for beginners. And to be honest, title should have been “C Multithreading” since it uses pthreads, and not C++11 for threading.
So what would be the output? In what order numbers will be printed? That’s the small puzzle for you.
To make you really think, I won’t give answer. You are free to share your answer in comments though. And hey running the program without thinking would be considered cheating!
Don’t you cheat!
