Presentation is loading. Please wait.

Presentation is loading. Please wait.

1HW13 Modify ThreadSafeBankAccount2 to use an assertion that checks a lock is released. Learn how to compile and run Java code with assertions. Define.

Similar presentations


Presentation on theme: "1HW13 Modify ThreadSafeBankAccount2 to use an assertion that checks a lock is released. Learn how to compile and run Java code with assertions. Define."— Presentation transcript:

1 1HW13 Modify ThreadSafeBankAccount2 to use an assertion that checks a lock is released. Learn how to compile and run Java code with assertions. Define two Ant targets; one to run your program with an assertion enabled, and the other with the assertion disabled. (Either one can be the default target.) Due: Oct 11 (Thu) –Java file and build.xml –build.xml performs the default target, generates Java byte code and execute it.

2 2HW14 Modify DeadlockedBankAccount2.java to read “balance” with a read lock in if statements. Due 17 (Thu)

3 3HW15 AccessCounter –Maintains a map that pairs a file and access count. Use java.util.HashMap –increment() accepts a file path and increments the access count of the file –getCount() accepts a file path and returns the access count of the file. main() –runs multiple threads to call increment() and getCount() concurrently. java.util.HashMap is not thread safe. –Use read and write locks in HitCounter Due: April 18 (Thu)


Download ppt "1HW13 Modify ThreadSafeBankAccount2 to use an assertion that checks a lock is released. Learn how to compile and run Java code with assertions. Define."

Similar presentations


Ads by Google