-
-
Notifications
You must be signed in to change notification settings - Fork 658
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
Atomic operations. #10610
Atomic operations. #10610
Conversation
That |
That mov eax, dword ptr [rdi]
.LBB3_1: # =>This Inner Loop Header: Depth=1
mov ecx, eax
or ecx, esi
lock cmpxchg dword ptr [rdi], ecx
jne .LBB3_1
ret |
I read a bit about CAS loops and I think this is fine. The function application freaks me out a bit, but I suppose inlining is going to take care of everything here. However, that loop really looks like it wants to become a |
4f4b088
to
1c550d7
Compare
Alright, the loop has been changed to a The only problem remaining is the TestExceptions.testExceptions test breaking when using The exact error:
EDIT: I think I've fixed it? It seems to behave like other targets again, and the test passes. |
fcd0cae
to
ea48050
Compare
I've added an |
Could you resolve the conflict? |
70ffa78
to
46d2a6c
Compare
Resolved the conflict, everything should be working now. Hashlink test failure is due to the new native Int64 impl. |
Fixed the issues with the new Int64 stuff in #10860 and HaxeFoundation/hashlink#574. |
be39b78
to
1a7b367
Compare
Add some `inline`, and remove some unneeded `extern`.
1a7b367
to
f3a429b
Compare
Thank you for your work and patience! |
Even JavaScript has atomics now, no reason why Haxe shouldn't.
Supported targets:
The hashlink unit tests fail in
TestException
when settinghl_ver
to1.12.0
, because of 98df217Currentlyhaxe.Atomic<T>
is only implemented forInt
, but it should be possible to implement atomic operations for "all" types, at least on Hxcpp/Hashlink and probably Java and C# too.haxe.atomic.AtomicObject
is implemented for Hashlink, Java and C#.