Kapalı

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.

Beceriler: Java

Daha fazlasını gör: 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

İşveren Hakkında:
( 0 değerlendirme ) Philadelphia, United States

Proje NO: #29379526

Bu iş için 20 freelancer ortalamada $500 teklif veriyor

urmate

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 Daha Fazla

$350 USD in 7 gün içinde
(500 Değerlendirme)
7.3
p4logics

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 Daha Fazla

$750 USD in 7 gün içinde
(51 Değerlendirme)
6.6
paulprabhakarand

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 Daha Fazla

$600 USD in 20 gün içinde
(70 Değerlendirme)
6.3
prakash2813

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 Daha Fazla

$500 USD in 2 gün içinde
(130 Değerlendirme)
6.5
ExpertSoul

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. Daha Fazla

$500 USD in 10 gün içinde
(122 Değerlendirme)
6.3
hbxfnzwpf

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 Daha Fazla

$250 USD in 2 gün içinde
(87 Değerlendirme)
6.5
devvitaliy

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 Daha Fazla

$300 USD in 7 gün içinde
(38 Değerlendirme)
5.2
popularcontent12

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 Daha Fazla

$250 USD in 3 gün içinde
(46 Değerlendirme)
5.0
danilamakarov01

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 Daha Fazla

$500 USD in 7 gün içinde
(33 Değerlendirme)
5.0
ismailmousa8387

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 Daha Fazla

$500 USD in 7 gün içinde
(13 Değerlendirme)
4.9
engrkhanzain

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 Daha Fazla

$650 USD in 7 gün içinde
(31 Değerlendirme)
4.9
baltickriscoder

---------------------------------------------------------------------------------------- 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 Daha Fazla

$1000 USD in 7 gün içinde
(21 Değerlendirme)
4.8
Darwish001

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 in 7 gün içinde
(14 Değerlendirme)
5.3
maximous49

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 Daha Fazla

$500 USD in 7 gün içinde
(4 Değerlendirme)
3.5
citadel98

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 Daha Fazla

$500 USD in 3 gün içinde
(6 Değerlendirme)
3.1
Sniper14

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 Daha Fazla

$500 USD in 7 gün içinde
(4 Değerlendirme)
2.5
(3 Değerlendirme)
1.8
lgliao

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 Daha Fazla

$750 USD in 7 gün içinde
(0 Değerlendirme)
0.0
AndreyDubakov

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 Daha Fazla

$500 USD in 7 gün içinde
(0 Değerlendirme)
0.0
Manpreetsweden

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 Daha Fazla

$300 USD in 2 gün içinde
(0 Değerlendirme)
0.0