Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Atomicfu compiler plugin for native #261

Closed
5 tasks done
mvicsokolova opened this issue Nov 14, 2022 · 2 comments
Closed
5 tasks done

Atomicfu compiler plugin for native #261

mvicsokolova opened this issue Nov 14, 2022 · 2 comments
Assignees
Labels

Comments

@mvicsokolova
Copy link
Collaborator

mvicsokolova commented Nov 14, 2022

Since Kotlin 1.7.20 atomicfu compiler plugin supports both JVM and JS backends, performing IR transformations.
The next step is to support native backend.

The workflow for this task:

On the part of Kotlin/Native team:

On the part of atomicfu compiler plugin:

  • native test infrastructure
  • perform IR transformations replacing kotlinx.atomicfu.Atomic* classes with volatile values
  • implement atomic operations and basic inline functions via the stdlib intrinsics (compareAndSetField, compareAndSwapField, addAndGetField)
  • support atomic arrays
@mvicsokolova mvicsokolova self-assigned this Nov 14, 2022
@mvicsokolova
Copy link
Collaborator Author

mvicsokolova commented Feb 27, 2023

UPD

TODO:

  • support atomics initialised in init {} block
  • support top-level atomics

Other:

KotlinBuild pushed a commit to JetBrains/kotlin that referenced this issue Jul 31, 2023
Atomicfu compiler plugin supported transformations for K/N:
* atomic properties are replaced with volatile properties and all the operations are delegated to native atomic intrinsics
* atomic arrays are replaced with kotlin.concurrent.Atomic*Arrays
* all other features available on JVM are covered as well (custom atomic extensions, delegated properties, debug tracing)

See (KT-58358, Kotlin/kotlinx-atomicfu#261)

Merge-request: KT-MR-11253
Merged-by: Maria Sokolova <maria.sokolova@jetbrains.com>
@mvicsokolova
Copy link
Collaborator Author

mvicsokolova commented Jul 31, 2023

Starting from Kotlin version 1.9.20, atomicfu-compiler-plugin will provide support for the native backend

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant