avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@avalon.apache.org
Subject [jira] Closed: (RUNTIME-52) SimpleFIFO in Merlin model composition wastes CPU cycles
Date Sun, 15 Aug 2004 20:51:20 GMT

   The following issue has been closed.

   Resolver: Niclas Hedhman
       Date: Sun, 15 Aug 2004 1:50 PM

I am a bit paranoid about deadlocks, so I stick to things that I have proven to myself works
in the long-run (months/years). And since there is no measurable performance degradation,
I think we should stick with the 'safety net'.
View the issue:

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

     Status: Closed
   Priority: Major
 Resolution: WON'T FIX

    Project: Merlin Runtime

   Assignee: Niclas Hedhman
   Reporter: Carel Paradis

    Created: Sun, 15 Aug 2004 1:28 PM
    Updated: Sun, 15 Aug 2004 1:50 PM

The class SimpleFifo in the Merlin Model 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\composition\impl\src\java\org\apache\avalon\composition\model\impl\SimpleFIFO.java

Apply the following patch:

Index: SimpleFIFO.java
--- SimpleFIFO.java	(revision 36413)
+++ SimpleFIFO.java	(working copy)
@@ -48,7 +48,7 @@
         synchronized( this )
             m_Queue.add( obj );
-            notifyAll();
+            notify();
@@ -58,7 +58,7 @@
         synchronized( this )
             while( m_Queue.size() == 0 )
-                wait(100);
+                wait();
             return m_Queue.remove(0);
// -----END PATCH

This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:

If you want more information on JIRA, or have a bug to report see:

To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org

View raw message