Dominaezzz
01/28/2020, 4:51 PMkpgalligan
01/28/2020, 4:59 PMDominaezzz
01/28/2020, 5:09 PMStableRef
object itself.kpgalligan
01/28/2020, 5:10 PMDominaezzz
01/28/2020, 5:10 PMDominaezzz
01/28/2020, 5:11 PMkpgalligan
01/28/2020, 5:11 PMDominaezzz
01/28/2020, 5:11 PMDominaezzz
01/28/2020, 5:11 PMkpgalligan
01/28/2020, 5:11 PMDominaezzz
01/28/2020, 5:16 PMSam Schilling
01/28/2020, 5:53 PMTransferMode.UNSAFE
. My program would crash at random times with it while doing background thread work.Dominaezzz
01/28/2020, 5:53 PMkpgalligan
01/28/2020, 5:54 PMkpgalligan
01/28/2020, 5:54 PMSam Schilling
01/28/2020, 6:01 PMDominaezzz
01/28/2020, 7:38 PMDetachedMutableMap
. I just need to figure out the single-threaded issue.Dominaezzz
01/28/2020, 7:38 PMkpgalligan
01/28/2020, 7:45 PMDetachedMutableMap
works, it’s just not that useful in practice (in my experience). No idea what’s up with your safe issue, thoughDominaezzz
01/28/2020, 7:53 PMkpgalligan
01/28/2020, 7:58 PMDetachedObjectGraph
. Just copy/pasted. Anyway, I thought so too originally, but we just never use it. Stately’s shared collections with atomics “work”, but I’ve been meaning to rewrite them for a while. Keeping state by itself in a single thread is easier to deal with. For people that dislike the KN state model, keeping state in a separate thread will be another argument against it, but so far it’s working great. Hopefully will release a stately update next week-ishArkadii Ivanov
01/28/2020, 11:53 PMkpgalligan
01/28/2020, 11:56 PMArkadii Ivanov
01/29/2020, 12:03 AMkpgalligan
01/29/2020, 12:03 AMkpgalligan
01/29/2020, 12:04 AMkpgalligan
01/29/2020, 2:32 AMDominaezzz
01/29/2020, 3:21 AMDominaezzz
01/29/2020, 9:53 AMval umm = DetachedObjectGraph {
val map = mutableMapOf<String, String>()
for (entry in map.entries) {
// Do nothing.
}
map
} // kotlin.IllegalStateException: Illegal transfer state
println(umm.attach())
Dominaezzz
01/29/2020, 2:46 PMKavan
01/30/2020, 9:14 AMDominaezzz
01/30/2020, 10:16 AMKavan
01/30/2020, 11:08 AMKavan
01/30/2020, 11:10 AMKavan
01/30/2020, 11:11 AMDominaezzz
01/30/2020, 11:39 AMKavan
01/30/2020, 2:37 PMDominaezzz
01/30/2020, 2:39 PMMap<String, String>
interface, but they are just a cast away from being `MutableMap`s in the end. (Unless you're talking about EmptyMap
but that's not very useful here) .Kavan
01/30/2020, 2:44 PM