Concurrent System Design Case Study Solution
Let’s talk about your old java code. Things I found that would create a deadlock are basically
- Your code was not multi-threaded .i.e. single threaded. So, this would cause a dead lock when you have multiple transactions as by nature your system is multi-threaded (concurrent). The reason is single thread because single threaded applications work on main thread and whenever the user requests multiple resources, then it would be unable to do our desired task, which is why we have multi-threading as solution to such problems. I noticed this problem in your code, which is why I made separate threads for easy handling. You used synchronous keyword but you were not making use of it.
- Maybe another problem that would occur is synchronous reason is point 1.
- Other stuff was looking fine.
Things I have added and think that should be a part of this program are
Concurrent System Design Harvard Case Solution & Analysis
- Multi-threading for easy maintenance of code and handling of multi transactions at particular instance synchronously.
Below is the screenshot of the program’s final result.
- There is no deadlock in threads, as they are running synchronously.
- I have managed concurrency of your application by multi-threading.
- I have improved FSP by adding multi-threads.
class diagram of program.............
This is just a sample partial case solution. Please place the order on the website to order your own originally done case solution.