I don't actually remember now, but it's possible that when core.async was 
created we were still trying to accommodate an older version of Java before 
some of those existed. That's not an issue now as we only need to support 
Java 1.8+. So, I don't know of any reason these wouldn't be an option. 
Would be happy to see a core.async issue and/or patch (may need to sign the 
CA and become the contributor first).

On Thursday, September 10, 2020 at 8:14:53 AM UTC-5 Jim foo.bar wrote:

> Hi folks, 
>
> `LinkedList` is used as the underlying data-structure for all core.async 
> buffers. However, looking closer reveals that what is really needed is a 
> `Deque` (for its .addFirst/.removeLast methods). So naturally then it 
> begs the question - why not `ArrayDeque` [1]? It should offer superior 
> insertion/removal/traversing performance, and in the context of 
> core.async it will never be resized (if initialised with `n`). 
>
> And since we're on the subject, why not even go crazy with a 
> (thread-safe) `ConcurrentLinkedDeque` [2] ? Leaving the counting 
> complication aside for a moment (something which I wouldn't mind 
> feedback on), having a thread-safe buffer opens up the door to safe 
> buffer snapshots. 
>
> Anything wrong with either of those approaches? Many thanks in advance... 
>
> Kind regards, 
>
> Dimitris 
>
> [1]: 
>
> https://github.com/jimpil/asynctopia/blob/master/src/asynctopia/buffers/array.clj
>  
>
> [2]: 
>
> https://github.com/jimpil/asynctopia/blob/master/src/asynctopia/buffers/thread_safe.clj
>  
>
>
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/7ab00670-4768-4738-8f18-77406bd1fdcfn%40googlegroups.com.

Reply via email to