Question: Project 2 : An Application Employing Synchronized / Cooperating Multiple Threads In Java Using Locks A Banking Simulator Points: 1 0 0 points Due Date:
Project : An Application Employing SynchronizedCooperating Multiple
Threads In Java Using Locks A Banking Simulator
Points: points
Due Date: Sunday September by : pm WebCourses time
Objectives: To develop an application which requires cooperating, synchronized
multiple threads of execution.
Project Overview: In this project you will simulate the deposits and withdrawals
made to fictitious bank accounts Ill let you use my real bank accounts if you
promise to make only deposits! J In this case the deposits and withdrawals will
be made by user agents synchronized threads Synchronization is required for
two reasons mutual exclusion updates cannot be lost and because a
withdrawal cannot occur if the amount of the withdrawal request is greater than
the current balance in the account. This means that access to the account the
shared object must be synchronized. This application requires cooperation and
communication amongst the various agents cooperating synchronized threads
In other words, this problem is similar to the producerconsumer problem where
there is more than one producer and more than one consumer process active
simultaneously. If a withdrawal agent attempts to withdraw an amount greater
than the current balance in the account then it must block itself and wait until a
depositing agent has added money to the account before it can try again. As we
covered in the lecture notes, this will require that the depositing agents signal all
waiting withdrawing agents whenever a deposit is completed.
Agents: There are five different types of agents in this simulation as follows:
Depositor Agents: These agents add money to a bank account. To keep
things relatively simple, assume that deposits are made in random
amounts ranging from $ to $whole dollars only Depositor agents
never block.
Withdrawal Agents: These agents remove money from a bank account.
Withdrawal agents will make withdrawals in random amounts ranging from
$ to $again whole dollars only Withdrawal agents block if the
balance of the account in question is less than the amount the withdrawal
CNT Project Fall
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
