Basic std::thread usage
1 Minions reporting
Question: Write a program in minions.cpp that takes a number of minion as a command line parameter. Start one thread per minion so that the thread prints Hello! I am minion x where x is the number of that particular minion. All these threads should run concurrently. Once all the threads have terminated, create an other thread that says: hello Minions! I am the Overlord!.
You can use make run to run your program with 40 minions.
Note that the output may be mangled when all the minion threads are printing; that is fine. Though the message from the overlord should always come last.
Reviews
There are no reviews yet.