Assignment 6: Multi Threading & Synchronization Dr. Huaqing Wang I. Purposes: - Multiple Threading. - Monitor and Synchronization - Classic Synchronization Problems. II. Files: - "3ClassicSynchronization.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 or different machine with shared variables/data. Now we deal with programs or threads running on the same machine, and the the cases of running different machines need sockets or RMV (Vemote Method Invocation) technology. - One or more programs/threads access, especially modify, the data the result data may not correct, or inconsistant. The technique of synchnoization (implemented by mutual exclusion) is the key. - The code sections accessing shared data are called "critical section" and they should be "mutually exclusively" excuted. - Java gives two tools, socket (for link programs/threads running on different machines and monitor for mutual exclusionse. - A monitor in Java is class with mutully 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.