https://kotlinlang.org logo
#ios
Title
# ios
m

Megan Teahan

03/15/2021, 9:05 PM
Hello all, I’ve been talking to my team about using KMP for our iOS development. The developers have concerns around the concurrency model for Kotlin/Native. I’ve read about Immutability and Concurrency on Kotlins website, along with an overview on the KMM site. Also watched some videos that explain and walk through this concept by Kevin Galligan:

original talk

  and updated version. Kevin’s videos talk a lot about the concept and also ways to design with intention. It definitely seems like a trouble spot, but seems like issues are avoidable with intentional design with what is immutable vs mutable, Atomics in some cases, and potentially using the coroutines native-mt branch for multithreading. I was hoping to get others thoughts an opinions who use Kotlin for Native development. Has this been a non-starter for using Kotlin/Native for anyone who has looked into this topic or is something that’s workable? Or are there any other resources people recommend reading to better design for Native’s concurrency model?
k

kpgalligan

03/18/2021, 6:18 PM
Nobody replied! I have follow on thoughts, as it's been almost a year and a half since the talk. I guess the first thing to mention is the feedback from that talk was basically "wow, that's a lot". I tried to cram everything in there, but you really don't need to know "everything". I wound up writing some blog posts after that were more focused around practical info vs "everything" (https://dev.to/touchlab/practical-kotlin-native-concurrency-ac7), and ultimately that turned into some of the "official" docs/hands-on (https://play.kotlinlang.org/hands-on/Kotlin%20Native%20Concurrency/00_Introduction).
Has this been a non-starter for using Kotlin/Native for anyone who has looked into this topic or is something that’s workable?
I'd say yes and yes. Some teams look at it and decide it won't work, or run into some issues and give up. Other teams seem to have little trouble. It isn't the easiest thing in the world to adjust to, for sure, and if you are integrating in an already complex app, it may be tricky, but in general it's workable. The model will change at some point, after which this shouldn't be an issue, but there's no public ETA on that change. So, for now, freezing etc.
👍 1
m

Megan Teahan

03/18/2021, 7:35 PM
Thank you so much for the reply! I really enjoyed your talks and thanks for the other docs, I’ll look them over. 😄
👍 1
8 Views