Salut,
I can add that information to the files.
I don't like the duplicate code either. Hence my suggestion of making
CircularQueue & LinkedList plug-able.
Did you ever do any comparisons of a "LinkedListPipeline extends
LinkedList" versus a "LinkedListPipeline" that uses a LinkedList as a
composite of LinkedListPipeline? If you happen to code this and try
it, could you put the LinkedList as the first non-static reference in
the list of fields for the LinkedListPipeline?
If the "extends LinkedList" performs better, I think I know the reason why.
A+
charlie ...
Jeanfrancois Arcand wrote:
> Salut,
>
> comment inline.
>
> charlie hunt wrote:
>> Salut,
>>
>> I'm attaching the CircularQueuePipeline. It's actually two files.
>> One is a CircularQueue data structure which supports the APIs needed
>> by the CircularQueuePipeline.
>>
>> I think we talked about this before at one time?
>>
>> I wonder if we should consider making CircularQueue or LinkedList
>> plug-able into the Pipeline?
>>
>> Since you're the Pipeline expert, would you like to do a quick review
>> of this implementation?
>>
>> A+
>>
>> charlie ...
>>
>> PS: I did some performance testing with this Pipeline versus the
>> LinkedListPipeline. The CircularQueuePipeline will perform better
>> under circumstances where there gets to be large number of entries in
>> the queue waiting to be executed. But, that's not a desire-able
>> situation. It also does slightly better on systems with small CPU
>> caches relative to the number of virtual processors (i.e. SPARC T1/T2
>> processors). The underlying circular queue being an array is more
>> CPU cache friendly being an array than a set of linked list nodes
>> which could be scattered randomly throughout memory. But, on
>> traditional x86 architectures, it appears LinkedListPipeline does
>> slightly better than CircularQueuePipeline, especially if the number
>> of entries in the LinkedList is relatively small.
>
> Can you add that information inside the class description? This is
> quite interesting!
>
> One comment CircularQueuePipeline: your class share a lot of code
> (same code) with LinkedListPipeline. Would be nice if you can refactor
> both class and make then sharing the code. Because now both have the
> exact same code :-)
>
>>
>> charlie ...
>>