Menu

[Solved]-Q2 Required Create Five Threads B C D E Main Thread Thread Recreated Pthreadjoin Must Used Q37199107

Q.2 You are required to create five threads A, B, C, D and E in Main thread, but no thread should be recreated. pthread_join(This question needs to be doneusing Mutex Locks and Semaphores (linux based, C++)

Q.2 You are required to create five threads A, B, C, D and E in Main thread, but no thread should be recreated. pthread_join() must not be used. Use semaphores to synchronize the execution of threads. These threads do nothing other than printing the following messages repeatedly. Thread A prints: ping Thread B prints: pong Thread C prints: ting Thread D prints: tring Thread E prints: trung Message must be printed in a sequence mentioned below. ping pong ting pong tring tring trung ping pong ting pong tring tring trung ping pong ting pong tring tring trung Show transcribed image text Q.2 You are required to create five threads A, B, C, D and E in Main thread, but no thread should be recreated. pthread_join() must not be used. Use semaphores to synchronize the execution of threads. These threads do nothing other than printing the following messages repeatedly. Thread A prints: ping Thread B prints: pong Thread C prints: ting Thread D prints: tring Thread E prints: trung Message must be printed in a sequence mentioned below. ping pong ting pong tring tring trung ping pong ting pong tring tring trung ping pong ting pong tring tring trung

Expert Answer


Answer to Q.2 You are required to create five threads A, B, C, D and E in Main thread, but no thread should be recreated. pthread_… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *