Java Project

Task 1. Run the initial program as is to observe the race condition and explain how the race condition may occur. Draw a simple UML sequence diagram to support your explanation. Add your explanation and the sequence diagram to [login to view URL] (Links to an external site.)

You can force the race condition to be more apparent by uncommenting the [login to view URL]() statements in the Account class.

Task 2. Implement protection code to resolve the race condition issue. Your solution must allow the bank to transfer multiple funds between unrelated accounts, e.g. from account [2] to account [5] and from account [3] to account [7] at the same time. You may use either synchronized object locks or classes implementing the Lock interface to prevent two transferring threads from accessing the same global variables simultaneously.

In addition to testing the bank at the end of all the transfers, we also want to test it periodically. Uncomment the line in [login to view URL] that reads: if (shouldTest()) test();

Run the program again and you will notice now that the test method reports an error again. This is because while the test method is summing the amounts in each account in one thread, transfers are still taking place in other threads. This is the source of another race condition. In the next tasks we will fix this.

Task 3. Refactor the method of testing into a new separate thread.

Task 4. Provide code protection so that the newly-created testing thread and any other transfer threads are running exclusively.

Now we have protected the critical sections of the code by providing mutual exclusion between the testing thread and the transfer threads. But we want to run the test at regular intervals, so we need a solution to guarantee that the test runs at the right time.

Task 5. Implement a wait/signal solution for the testing thread and transfer threads, i.e. the testing thread starts with a signal to all transferring threads, waits for all the transferring threads to finish the current transfer, and then takes over the testing task while all the transferring threads are waiting until the test is done.

Task 6. The initial code does not allow an account to transfer out funds if the transferring amount is greater than the account balance. Implement a wait/notify solution to defer the transfer until the account balance becomes greater than the transferring amount (assume the account will receive the funds later).

Task 7. Deadlock condition may occur if one thread finishes all the funds transfers and exits. Implement a solution in which all threads stop transferring (the bank is closed) whenever one thread completes its transfers. This will solve the deadlock issue.

Kemahiran: Java

Lihat lagi: java project ffmpeg source code, open source struts java project, java project source codes health managment, java project row source code, multithreading java project source, courier service java project download source code, free source code multiplayer car game java project, java project hospital management screenshots source code, java project hostel management system source code, java project source code hostel management, source code java project online booking management system, source code java project online doctor, java project scientific calculator source, java project movie ticket booking source code, java swing calculator source code complete project, java scientific calculator source code project report, open source ocr java project, simple java project with source code, java project with source code

Tentang Majikan:
( 0 ulasan ) Philadelphia, United States

ID Projek: #29379526

20 pekerja bebas membida secara purata $500 untuk pekerjaan ini


Hi there Contact me will all your project details to discuss it further. I am a senior programmer with practical development experience in various programming languages. I can provide a quality solution for your proje Lagi

$350 USD dalam 7 hari
(500 Ulasan)

Dear Sir, I'm expert in java, j2ee, Java spring boot, data structure and algorithm. I have gone through your requirement, I can do complete in deadline. Please ping me we can discuss and can start your project right Lagi

$750 USD dalam 7 hari
(51 Ulasan)

Hi, I am an expert developer on C, C++, Java, Python and MYSQL. More than a decade I was working for an American software company afterwards I started working as a consultant. Several data structure algorithms implemen Lagi

$600 USD dalam 20 hari
(70 Ulasan)

Hi there, I am java developer with 7+ years of experience in web and desktop app and game development. I have strong expertise in oop, data structures, statistics, multi threading, networking, genetic algorithm impleme Lagi

$500 USD dalam 2 hari
(130 Ulasan)

Hello, I've complete MS Software Engineering. I've 5-Year experience in Java development and algorithm implementation. My Core Expertise in Java - C++ - C - object-oriented - Data Structure - Swing - OpenGL - JavaFX. Lagi

$500 USD dalam 10 hari
(122 Ulasan)

I am very proficient in java. I have 17 years java developing experience now, and have worked for more than 10 years. My work is online game developing, and mainly focus on server side, using java under Linux environme Lagi

$250 USD dalam 2 hari
(87 Ulasan)

Hello JAVA EXPERT I have read your description and I am so interested in your project. You can see well experienced and skillful Java +15 years of experience in software development. Confident in your project and I can Lagi

$300 USD dalam 7 hari
(38 Ulasan)

Hello, I am a software and Web Developer. I hava also lot of experience in Designing. I have some rules and regulations before start of project: 1. Provide 100% work within deadline. 2. Provide unlimited revisions un Lagi

$250 USD dalam 3 hari
(46 Ulasan)

Hi, I can start work immediately. I have just read your project in detail and your project is very wonderful. I have rich experiences about your project and I can finish your project perfectly and on time. I am the bes Lagi

$500 USD dalam 7 hari
(33 Ulasan)

How are you? I can implement your Java project. Thank you for checking my bid. I understand your needs and I think I can do it. If you hire me, I will do my best for you. I hope you would contact me and discuss details Lagi

$500 USD dalam 7 hari
(13 Ulasan)

NOTE:I checked the attached file but not more deeply because may be i have some questions regarding to project, so its batter if you come to chat and we discuss more about it. I am a Java developer having 7 years of e Lagi

$650 USD dalam 7 hari
(31 Ulasan)

---------------------------------------------------------------------------------------- Dear Client, Nice to meet you. I have read your description and I am so interested in your project. I am 5+yrs experience in Java Lagi

$1000 USD dalam 7 hari
(21 Ulasan)

Hi, Hope you are doing well. I have full experience about Java/JavaFX so that I can handle your project perfectly. I will be very happy to discuss about your project via chatting. Thank you.

$500 USD dalam 7 hari
(14 Ulasan)

hi I am really interested in your project I am new to Freelancer so I placed a bid for a low price But I have full experience of Java programming I could finish your project in high quality, in short timeline I could s Lagi

$500 USD dalam 7 hari
(4 Ulasan)

JAVA EXPERT!!! HELLO DEAR CLIENT I have gone through your project details and the work is DOABLE since its within my area of EXPERTISE.I will tackle are required guideline to deliver desired goal Please consider my bid Lagi

$500 USD dalam 3 hari
(6 Ulasan)

Hi, I see that your project involves MultiThreading issue like race condition and deadlock , thing i am familiar with , I am an experimented java developer with more than 6yrs in development of complex apps using java Lagi

$500 USD dalam 7 hari
(4 Ulasan)
(3 Ulasan)

I have over 20 years of Java development experiences and I'm very familiar with the technical details in your project task descriptions. In particular, I have been developing and maintaining backend Java codes that in Lagi

$750 USD dalam 7 hari
(0 Ulasan)

Hello. I'm pretty happy to bid on this interesting project. I read your description carefully and I think that I am the developer you are looking for and are suitable for this task. I have rich experience in Java, Thre Lagi

$500 USD dalam 7 hari
(0 Ulasan)

Hello. I hope you are doing well. I am a senior programmer and have 5+ years of Java. I have carried out many Java projects such as web scraping, jsp, search engine. So I can solve your problem in a very short time. Yo Lagi

$300 USD dalam 2 hari
(0 Ulasan)