java-design-patterns icon indicating copy to clipboard operation
java-design-patterns copied to clipboard

Improving loops in BallThread.java & updating its README.md.

Open Francisco-G-P opened this issue 9 months ago • 3 comments

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!

Francisco-G-P avatar Mar 18 '25 21:03 Francisco-G-P

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

github-actions[bot] avatar Mar 18 '25 21:03 github-actions[bot]

The build is failing. Please ensure that all the checks pass before requesting review.

iluwatar avatar Mar 19 '25 16:03 iluwatar

This PR is stale because it has been open 60 days with no activity.

github-actions[bot] avatar May 19 '25 02:05 github-actions[bot]

Closed due to inactivity. Thank you for the contribution.

iluwatar avatar Oct 15 '25 16:10 iluwatar