Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoiding deadlock in Java #44

Open
ShivangiSingh17 opened this issue Oct 6, 2019 · 2 comments
Open

Avoiding deadlock in Java #44

ShivangiSingh17 opened this issue Oct 6, 2019 · 2 comments

Comments

@ShivangiSingh17
Copy link
Owner

ShivangiSingh17 commented Oct 6, 2019

Write a Java code where a resource is accessed by multiple threads. You need to write code in such a way that no deadlock should occur.
Hint: The trick to solve this problem is acquiring resources in order and release them in reverse order, e.g. first acquire resource R1 and only if you have got R1 to go for R2. This way, you can avoid deadlock.

@priyamm
Copy link

priyamm commented Oct 6, 2019

@ShivangiSingh17 update the description

@Keerthana-Thiagaraj
Copy link

Hi, i would like to work on this. Kindly assign on my name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants