support@chatgptassignment.com

semaphores to solve a number of synchronization problems between cooperating threads. important to note that:

Mutex  locks and semaphores, as discussed in class, are different techniques to  solve the race condition and to ensure an efficient synchronization  between cooperating threads and processes. you will use semaphores to  solve a number of synchronization problems between cooperating threads. important to note that: •  Semaphore, in literature, uses wait() and signal(). However, in the  standard library of Java, these functions are acquire() and release()  respectively. The same functionalities but with different names. In  the first question, the deposit and withdraw functions share a bank  account to add certain amount or subtract certain amount from the  balance, respectively. Use semaphore(s) to implement the synchronization. Deposit the input amount to the balance only if the current balance is less than 2000$ Deposit  doesn’t wait until this condition is true (If the condition is false,  skip adding the amount), thus use if statements rather than waiting  while loops Call the displayStatus() function after you deposit the amount and before release the lock Withdraw the input amount from the balance only if the current balance is greater than or equal to input amount Withdraw  doesn’t wait until this condition is true (if the condition is false,  skip withdrawing the amount), thus use if statements rather than waiting  while  loops Call the displayStatus() function after you remove the amount and before release the lock //Question1_WithdrawDeposit.java file //IMPLEMENT HERE the deposit functionality, //IMPLEMENT HERE the withdraw functionality,