Java Ctrie implementation

356 views
Skip to first unread message

James Abley

unread,
Nov 18, 2012, 10:22:30 AM11/18/12
to jvm-la...@googlegroups.com
I thought that someone (Rémi Forax?) had done a pure Java version, but I can't find it now and am wondering whether I have been having realistic dreams about data structures.

Can anyone point to any work in this area? I know about the scala version, but thought there had been a Java version kicking about.

Cheers,

James

Remi Forax

unread,
Nov 18, 2012, 10:50:01 AM11/18/12
to jvm-la...@googlegroups.com
On 11/18/2012 04:22 PM, James Abley wrote:

Hi James,

> I thought that someone (R�mi Forax?) had done a pure Java version, but
> I can't find it now and am wondering whether I have been having
> realistic dreams about data structures.

I've not written an implementation of a ctrie in Java, but there is an
implementation [1] for a very specific cache
with no CAS that works because there is only one possible value for a
key and because the invalidation is done
out of band on the whole cache (using a SwitchPoint). This
implementation uses the same principle as a ctrie but is not a ctrie.
I should also mention that this implementation works well for a small
number of keys and is not the fastest one
but other alternatives based on hash tables consumes more memory.

>
> Can anyone point to any work in this area? I know about the scala
> version, but thought there had been a Java version kicking about.


if you ask the very same question on the concurrency-interest mailing
list of Doug Lea [2],
I'm sure you will get an answer.

>
> Cheers,
>
> James

cheers,
R�mi

[1]
https://code.google.com/p/jsr292-cookbook/source/browse/trunk/multi-dispatch/src/jsr292/cookbook/mdispatch/ClassMHMap.java
[2] concurrenc...@cs.oswego.edu

Roman Levenstein

unread,
Nov 18, 2012, 12:24:36 PM11/18/12
to jvm-la...@googlegroups.com
Do you mean something like this?

This is my Java port of the implementation from the Scala collections library.

Cheers,
  Roman

James Abley

unread,
Nov 23, 2012, 3:16:08 AM11/23/12
to jvm-la...@googlegroups.com
Nice, thank you.


--
You received this message because you are subscribed to the Google Groups "JVM Languages" group.
To view this discussion on the web visit https://groups.google.com/d/msg/jvm-languages/-/pY98Qkp0xvwJ.

To post to this group, send email to jvm-la...@googlegroups.com.
To unsubscribe from this group, send email to jvm-language...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/jvm-languages?hl=en.

Reply all
Reply to author
Forward
0 new messages