Use chapters 5 and 6 of the concurrency textbook to answer the questions below.
- Define the concept of monitor as presented in sections 5.0 and 5.1. What features do they provide to developers of concurrent programs?
- Imagine a savings account that required a minimum balance of $5,000 and a maximum balance of $10,000 (to take advantage of a special interest rate, for example). As with all bank accounts, it may be updated by many different sources concurrently (e.g. the bank, each owner on the account) either with deposits or withdrawals. Write a partial FSP specification that shows the condition synchronization that must be in place to allow withdrawals and deposits while maintaining the balance constraints. Using the information on pages 84 and 85 of the concurrency textbook, translate your partial FSP specification into its corresponding Java methods. You do NOT need to create a full FSP specification for this problem, now do you need to create a full Java implementation of this problem. Just focus on the parts relevant to the issue of condition synchronization.
- What are the four conditions needed to create deadlock in a concurrent system? Given that the book's initial model of the Dining Philosophers problem met these four conditions, why was it that the initial implementation of the Dining Philosophers applet could run for quite some time without deadlock?
Please submit your work by uploading either a .txt document or a .pdf document containing your answers to these questions. Do NOT submit .doc, .docx, .odt, or other document formats. (Note to Microsoft Word users: If you don't want to create a .pdf document, Word should provide a "Save as Text" command to create a .txt version of your document.)
In-class students: Submit your work for this assignment by 11:55 PM on Monday, March 17th.
CAETE students: Submit your work for this assignment by 11:55 PM on Monday, March 24th.