Hi Matt and community,

About thread safety: I keep an int counting modifications (called
modCount). Now, spliterator/iterator/sublist check that modCount ==
expectedModCount, and if that is not the case, throws
ConcurrentModificationException. Basically, it resembles the fail-fast
behavior of ArrayList/LinkedList. In order to deal with concurrency, one
should wrap an instance of IndexedLinkedList into
Collections.synchronizedList(...).

About Guava: they happily turned down my offer.

Best regards,
rodde

la 11.6.2022 klo 19.44 Matt Sicker <boa...@gmail.com> kirjoitti:

> Looks pretty interesting. I’ll be honest that my own data structure
> expertise revolves around immutable persistent patterns rather than mutable
> ones, but your class makes perfect sense as a mutable one.
>
> Do you have any notes on thread safety?
>
> While it’s neat that you’re submitting to the JDK as well, that sort of
> process is fairly long term, so I’d imagine that Collections would be a
> great place for it. If you’re trying to donate this to multiple projects,
> then Eclipse also has a collections library that might like it, and Guava
> might like it, too.
>
> —
> Matt Sicker
>
> > On Jun 10, 2022, at 14:30, Rodion Efremov <codero...@gmail.com> wrote:
> >
> > Hi,
> >
> > I have this List/Deque data structure:
> >
> > https://github.com/coderodde/IndexedLinkedList
> >
> > In a versatile benchmark, it outperforms the O(log n) TreeList easily by
> > the factor of 2. (Also, it requires less memory than TreeList.)
> >
> > What do you think? Does it deserve to be included in collections?
> >
> > Best regards,
> > rodde
>

Reply via email to