Improving loops in BallThread.java & updating its README.md.
Pull Request Template
What does this PR do?
This pull request solves the issue of unnecessary CPU usage, as it also updates the README.md, of the file BallThread.java.
Changes apply to Issue #2977 (Fix busy-waiting loops); already existing issue regarding the resources consumption due to inefficient loops.
All the best, Francisco!
PR Summary
This PR improves the efficiency of the BallThread class by fixing busy-waiting loops and adds a Spanish translation for the MapReduce README. The updated BallThread uses synchronization to prevent unnecessary CPU usage.
Changes
| File | Summary |
|---|---|
localization/es/map-reduce/README.md |
This file contains a Spanish translation of the MapReduce README. It provides a detailed explanation of the MapReduce design pattern, including its intent, real-world examples, Java code implementation, advantages, disadvantages, and related patterns. |
twin/README.md |
Minor updates to the README, including improved formatting and minor wording changes for better clarity and consistency. No functional changes were made. |
twin/src/main/java/com/iluwatar/twin/BallThread.java |
The BallThread class was updated to use synchronization mechanisms (synchronized, wait, notifyAll) to handle thread suspension and improve responsiveness. The isSuspended variable is no longer volatile, and the stopMe method now ensures a clean exit. |
autogenerated by presubmit.ai
The build is failing. Please ensure that all the checks pass before requesting review.
This PR is stale because it has been open 60 days with no activity.
Closed due to inactivity. Thank you for the contribution.