Message:

  A new issue has been created in JIRA.

---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/RUNTIME-51

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: RUNTIME-51
    Summary: SimpleFIFO in Merlin implementation wastes CPU cycles
       Type: Improvement

     Status: Open
   Priority: Major

    Project: Merlin Runtime
 Components: 
             CORE
   Versions:
             3.4.0

   Assignee: Stephen McConnell
   Reporter: Carel Paradis

    Created: Sun, 15 Aug 2004 1:22 PM
    Updated: Sun, 15 Aug 2004 1:22 PM

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 )
         {
             m_Queue.add( obj );
-            notifyAll();
+            notify();
         }
     }
     
@@ -52,7 +52,7 @@
         synchronized( this )
         {
             while( m_Queue.size() == 0 )
-                wait(100);
+                wait();
             return m_Queue.remove(0);
         }
     }
// -----END PATCH


---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to