Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Won't Fix
-
3.4.0
-
None
-
None
Description
The class SimpleFifo in the Merlin implementation wastes CPU cycles every 100 ms. The method get verify if the queue is no longer empty every 100 ms instead of waiting to be notified when a new element is added to the queue. Also, the put method notifies all waiting threads instead of notifying only one thread. It is not necessary to notify all threads because if many threads are waiting, then only one can get the newly added element.
The following file must be updated: trunk\runtime\merlin\impl\src\java\org\apache\avalon\merlin\impl\SimpleFIFO.java
Apply the following patch:
// -----BEGIN PATCH
Index: SimpleFIFO.java
===================================================================
— SimpleFIFO.java (revision 36413)
+++ SimpleFIFO.java (working copy)
@@ -42,7 +42,7 @@
synchronized( this )
}
@@ -52,7 +52,7 @@
synchronized( this )
}
// -----END PATCH