Write a program (in C, or Java, or C++, or C#- or Python) that creates three new threads (besides the already existing main thread) and synchronizes them in such a way that each thread displays it's thread id in turn for 5 iterations. The output of the program should look like this:
Program commented appropriately/header i.e.
#Full Name#Course ID#Date
Thread 1 - iteration no. 1Thread 2 - iteration no. 1Thread 3 - iteration no. 1Thread 1 - iteration no. 2Thread 2 - iteration no. 2Thread 3 - iteration no. 2Thread 1 - iteration no. 3Thread 2 - iteration no. 3Thread 3 - iteration no. 3Thread 1 - iteration no. 4Thread 2 - iteration no. 4Thread 3 - iteration no. 4Thread 1 - iteration no. 5Thread 2 - iteration no. 5Thread 3 - iteration no. 5Deliverables: the source code + a screenshot of the running program.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here