HardScenarioMultithreading and Concurrency
Two threads update a shared counter and the total is sometimes wrong. How do you find and fix it?
This answer is part of Pro
12 of 61 Java Developer answers are free. A Pro pass opens the rest, including hands-on task steps.
PreviousYour thread pool queue grows without bound and the service runs out of memory under load. What do you change?Next What are strong, soft, weak and phantom references?