How do you ensure that n threads can access n resources without deadlock?
Answer / Vakeel Chand
To avoid deadlock in multi-threaded programming, follow these practices: (1) Acquire resources in the same order every time. (2) Don't hold locks on multiple resources for a long time. (3) Use synchronized blocks instead of methods whenever possible.
| Is This Answer Correct ? | 0 Yes | 0 No |
Explain java coding standards for methods?
What are types of Java applications?
What is use of static in java?
Can memory leak happen java?
What is the name of the java compiler?
Explain the difference between static and dynamic binding in java?
Is void a wrapper class?
Name the components that are termed to be Heavy-weight component but available in Light-weight components?
How to create packages in java?
What are streams?
Explain the difference between getAppletInfo and getParameterInfo?
Why java does not support pointers?