https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
e

elect

10/23/2023, 2:15 PM
what could be a Kotlin MP counterpart of the Java
Vector
(essentially a thread safe
ArrayList
)?
p

p-schneider

10/23/2023, 2:45 PM
I'm not sure if there is something useful for your situation in https://github.com/Kotlin/kotlinx-atomicfu. I haven't used it directly yet. I've only seen it as transitive dependency in my projects so far. But that's more like
java.util.concurrent.atomic.Atomic*Array
and not the same as Vector.
e

elect

10/23/2023, 2:45 PM
thanks for the head up, I'll give it a look
m

Michael Paus

10/23/2023, 3:19 PM
Maybe in the long run it would be better to have a look at https://github.com/Kotlin/kotlinx.collections.immutable instead.
👍 2
k

kpgalligan

10/23/2023, 4:24 PM
I don't think atomicfu has collections, just locks and atomics, although I could be wrong. We implemented a very basic set of concurrently collection here: https://github.com/touchlab/Stately/, module
stately-concurrent-collections
. I assume something more comprehensive will be released at some point by somebody, but haven't heard of anything yet.
2 Views