-
Notifications
You must be signed in to change notification settings - Fork 423
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
Support for atomic class variables #18461
Comments
Right, we have https://chapel-lang.org/docs/modules/packages/AtomicObjects.html today. There are some meaningful steps we could take to improve this code and make it more production-ready, though. In particular:
|
Bumping this to say that an In particular I see |
@dlongnecke-cray : I think it's worth forking that into a separate issue if you're interested. While it feels loosely related to this one, it also feels pretty different. In the meantime, I wonder whether you could work around this using an approach like this: use CTypes;
type cPtrAsInt = c_intptr;
var x: atomic cPtrAsInt;
x.add(1);
writeln(x.read()); (along with some casting through |
I actually just went into Michael reminded me that supporting all pointer types will require we make sure we have double word lock free atomic instructions, so there's more of a design discussion to be had there. Which is exactly what this thread is about! I'll admit that at the time I was just searching for "support And I'll back Michael's post about Louis's code - having read and debugged it myself he uses the cas-128 instruction on x86-64. However Michael believes (don't quote me) that there should be pretty standardized support for 128-bit instructions today. So maybe not that hard to do? |
W.r.t. the first bullet in Michael's previous comment, @stonea has since extended the
Thinking about this living on main someday: what are the implications if my code doesn't |
I just did a |
The main reason I was asking was mild fear that — since The secondary/lesser reason would be just to reduce the number of modules we compile by default (a general theme I care about, though it hasn't been a focus in recent years) for compilation time reductions as you guessed. And I'd guess that there are many other modules already requiring |
As a Chapel programmer, I would like support for atomic classes that can be atomically
dereferenced, assigned, swapped, ....
If I recall correctly, one of the traditional high-level challenges here has been that since
Chapel class references are "wide" by default (can point across locales), they essentially
require 128-bit atomics or ... something fancy.
Related issues and PRs:
The text was updated successfully, but these errors were encountered: