Assignment 7: Multi Threading & Synchronization Dr. Huaqing Wang I. Purposes: - Multiple Threading. - Monitor and Synchronization - Classic Synchronization Problems. II. Files: - "threadSynchronization.zip" is a zip file contains 11 java source files for three classic synchronization problems. Those synchronization problems include Producer & Consumer, River crossing and Smoker problems. - There are one or more versions of solutions to each of those 3 problems. III. Key Conpcepts of Parallel/Concurrency Algorithms - Multiple programs/threads are working together on the same machine with shared variables/data. - One more than one programs/threads access, especially modify, the data the result data may not correct, or inconsistant. - The code sections accessing shared data are critical and they should be mutually exclusively excuted. - Java gives two tools, symorphon and monitor for mutual exclude the critical sections, so that syncrhronization can be enforced. - A monitor in Java is class with mututlly excusive data and/or function members IV. What You need to do for this assignment: - Compile and Run each of the files with main in it. To find whether a file has main in it, use "grep main *.java". Notice that if a program cannot run under Unix/Linex, run it under Windows environment. - Read and study at least one version of solution for each of three problems. - Learn the GUI programming skill and apply the skills to write a a solution to Dinning Philosophers program. - Read the dinning philosophers problem at https:://en.wikipedia.org/wiki/Dining_philosophers_problem - Write a Java GUI program to simulate 5-dinning philosoper problem.