anza-xyz / move

Move compiler targeting llvm supported backends
https://discord.gg/wFgfjG9J
Apache License 2.0
108 stars 33 forks source link

[Bug] Handle mutexes and probably atomics #320

Closed ksolana closed 12 months ago

ksolana commented 1 year ago

See: aptos-move/move-examples/defi/sources/locked_coins.move

EBPF documentation on atomics: https://www.kernel.org/doc/html/latest/bpf/instruction-set.html#atomic-operations

brson commented 1 year ago

I think that the locks in the referenced example are not machine-level locks, but instead logical locks on when and who are allowed to withdraw funds from a contract.

As far as I know, any machine-level concurrency between move transactions are handled in a way similar to solana - by analyzing the data dependencies between them and executing them in an order that does not produce concurrent mutations.

Move code will probably not need atomics.

ksolana commented 12 months ago

not required.