[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jakarta-commons-dev
Subject:    RE: DBCP
From:       "Waldhoff, Rodney" <rwaldhof () us ! britannica ! com>
Date:       2002-02-27 21:06:45
[Download RAW message or body]


Randy Speh wrote:

> Could someone please briefly explain why
> GenericObjectPool was implemented with
> CursorableLinkedList as its pool?  I guess I'm trying
> to understand why CursorableLinkedList is better that
> synchronizing calls to a java.util.Linklist object. 

When using LinkedList, any changes to the list will break any "open"
Iterators.  In CursorableLinkedList, a Cursor (a subclass of Iterator)
remains valid even if there are changes to the underlying list.  This is
useful if you'd like to make changes to the list in different threads, as
GenericObjectPool does with its Evictor thread (which runs asynchronously
with the borrow/return calls to the pool).


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic