You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by Aaron Smuts <AS...@therealm.com> on 2002/02/11 20:09:21 UTC

RE: cvs commit: jakarta-turbine-stratum/src/java/org/apache/strat um/jcs/utils/reuse TomcatJglQueue.java

For now, in the immediate future, would you mind commented out the old code
rather than removing it?  I'd prefer the clutter for the short term.  

Your changes should be fine though.

Aaron

> -----Original Message-----
> From: dlr@apache.org [mailto:dlr@apache.org]
> Sent: Sunday, February 10, 2002 9:34 PM
> To: jakarta-turbine-stratum-cvs@apache.org
> Subject: cvs commit: jakarta-turbine-
> stratum/src/java/org/apache/stratum/jcs/utils/reuse TomcatJglQueue.java
> 
> dlr         02/02/10 18:33:58
> 
>   Modified:    src/java/org/apache/stratum/jcs/utils/reuse
>                         TomcatJglQueue.java
>   Log:
>   Dropping JGL dep until its status can be assertained.  Aaron, I know
>   you have some (valid) concerns about the performance of LinkedList, so
>   let's see if we can get the source code for just this one class from
>   the JGL guys.  If not, perhaps we can find a faster LinkedList
>   implementation.
> 
>   Patch by Sam Ruby (with input from James Taylor):
> 
>   Recursion software (the last known owners of JGL) still appears to be
>   AWOL.  From a PMC point of view, I'm nervous about depending on
>   software who's licence I can't verify.  From a simple developer's
>   point of view, it bothers me to be depending on something that is
>   closed source and appears to be unsupported.  From both of these
>   perspectives, I offer this humble patch which converts from the JGL
>   implementation to the JDK's unsynchonized LinkedList.
> 
>   Revision  Changes    Path
>   1.5       +12 -10    jakarta-turbine-
> stratum/src/java/org/apache/stratum/jcs/utils/reuse/TomcatJglQueue.java
> 
>   Index: TomcatJglQueue.java
>   ===================================================================
>   RCS file: /home/cvs/jakarta-turbine-
> stratum/src/java/org/apache/stratum/jcs/utils/reuse/TomcatJglQueue.java,v
>   retrieving revision 1.4
>   retrieving revision 1.5
>   diff -u -u -r1.4 -r1.5
>   --- TomcatJglQueue.java	18 Jan 2002 15:38:15 -0000	1.4
>   +++ TomcatJglQueue.java	11 Feb 2002 02:33:58 -0000	1.5
>   @@ -1,4 +1,3 @@
>   -
>    package org.apache.stratum.jcs.utils.reuse;
> 
>    /*
>   @@ -55,18 +54,22 @@
>     * <http://www.apache.org/>.
>     */
> 
>   +import java.util.LinkedList;
> 
>    /**
>   - *  A simple FIFO queue class which causes the calling thread to wait
> if the
>   - *  queue is empty and notifies threads that are waiting when it is not
> empty.
>   - *  Implemented using JGL for better performance.
>   + *  A simple FIFO queue class which causes the calling thread to wait
>   + *  if the queue is empty and notifies threads that are waiting when
>   + *  it is not empty.  Previously implemented using JGL for better
>   + *  performance, this class has been moved back to a
>   + *  <code>LinkedList</code>-based implementation to reduce
>   + *  dependencies.
>     *
>     *@author     <a href="mailto:asmuts@yahoo.com">Aaron Smuts</a>
>     *@created    January 15, 2002
>     */
>    public class TomcatJglQueue implements ITomcatQueue
>    {
>   -    private IJglQueue q = new JglQueue();
>   +    private LinkedList q = new LinkedList();
> 
> 
>        /**
>   @@ -78,7 +81,7 @@
>        {
>            synchronized ( q )
>            {
>   -            q.push( object );
>   +            q.addLast( object );
>                q.notify();
>            }
>        }
>   @@ -102,7 +105,7 @@
>                    catch ( InterruptedException ex )
>                    {}
>                }
>   -            return q.pop();
>   +            return q.removeFirst();
>            }
>        }
> 
>   @@ -117,7 +120,7 @@
>        {
>            synchronized ( q )
>            {
>   -            return q.isEmpty() ? null : q.pop();
>   +            return q.isEmpty() ? null : q.removeFirst();
>            }
>        }
> 
>   @@ -131,7 +134,7 @@
>        {
>            synchronized ( q )
>            {
>   -            return q.isEmpty() ? null : q.front();
>   +            return q.isEmpty() ? null : q.getFirst();
>            }
>        }
> 
>   @@ -157,4 +160,3 @@
>            return q.size();
>        }
>    }
>   -
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:turbine-dev-
> unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:turbine-dev-
> help@jakarta.apache.org>

Re: cvs commit: jakarta-turbine-stratum/src/java/org/apache/strat um/jcs/utils/reuse TomcatJglQueue.java

Posted by Daniel Rall <dl...@finemaltcoding.com>.
Aaron Smuts <AS...@therealm.com> writes:

> For now, in the immediate future, would you mind commented out the old code
> rather than removing it?  I'd prefer the clutter for the short term.  
>
> Your changes should be fine though.

I don't quite follow, as that's what version control is for.
Executing `cvs diff -r 1.4 TomcatJglQueue.java` provides the same
information.  If I didn't know which revision to look for, executing
`cvs log TomcatJglQueue.java | less` would show me.

Additionally, I'm beginning to think that IFastQueue should be dropped
entirely in favor of Doug Lea's collections.  Aaron, thoughts?

Dan


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>