Hey all, what is the best way of implementing func...
# touchlab-tools
p
Hey all, what is the best way of implementing functionality similar to JVM Collections.synchronizedList only by using Kotlin/Native? Thanks! https://developer.android.com/reference/java/util/Collections#synchronizedList(java.util.List%3CT%3E)
t
Data access is guaranteed to be from one thread only in Kotlin/Native, so this would have no point.
k
Stately has 2 basic ways to do this. The iso collections linked above is probably the better of the two. There’s an older collection model I wrote with AtomicReference, but the performance is generally worse.
p
Thanks for helpful advice. Just to check my understanding - none of these iso collections are supposed to be used in platform specific modules, they can be accessed & they will only work inside commonMain module - is this correct?
k
You could use them in just native, if that’s what you’re looking to do.