CMSC 335 CMSC335 Homework 4 Answer (UMUC)
CMSC 335 Homework 4 Answer / Object-Oriented and Concurrent Programming
1. (20 pts) For the following program, explain the interesting elements related to threads.
2. (20 pts) What is changed if the method called on line 7, start(), is replaced with run()? Explain (of course).
3. (20 pts) What is changed if the method Thread.yield() is added between lines 23 and 24? Explain.
4. (20 pts) List and explain the threads running in your Sorcerer's Cave program as reported by jconsole. Note that you can name the threads created in the program, as is done on line 6 in Problem 1 above, which can make this discussion a lot easier to follow.
5. (20 pts) Explain how the java.util.concurrent.Semaphore might class be used in the Sorcerer's Cave program, final project, to coordinate the requirements of the various jobs. Then address the question of whether or not this actually makes sense in the context of the requirements of program. In other words, can you suggest approaches to handling shared resource pools that would be simpler than using semaphores?
We Also Recommend
"Applying Skills Learned" Please respond to the following- From the e-Activity, explain what you learned about the Website you selected
(TCO 3) Managers are often required to make decisions about the future based