Join Slack
Powered by
can anyone help me understand how atomicfu library...
# kotlin-native
w
william
11/06/2020, 12:08 AM
can anyone help me understand how atomicfu library works? what does it do under the hood that allows you to mutate something wrapped with
atomic(...)
? i understand that the object in
atomic
is frozen, but its unclear to me why it can be mutated. (also what does
fu
stand for / mean?)
e
ephemient
11/06/2020, 2:52 AM
*Atomic*{Integer,Long,Reference}*F*ield*U*pdater, see
https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/atomic/package-summary.html
ephemient
11/06/2020, 2:55 AM
on the JVM, the plugin rewrites the output bytecode to use Atomic*FieldUpdater or VarHandle, depending on configuration; on JS, it rewrites the output JS; on native, it wraps the Atomic* types from kotlin.native.concurrent
11
Views
Open in Slack
Previous
Next