-
Notifications
You must be signed in to change notification settings - Fork 2
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 Blocks for Concurrency? #31
Comments
Migrated from Whiley/WhileyCompiler#649 |
There are some implications around atomic blocks:
|
@GraemeSmith another one for you |
An interesting issue arises if we permit writes to global variables outside of atomic blocks (even if these are themselves atomic #45). Therefore, making this proposal and that for reading / writing global variables atomically coherent requires care:
Presumably, the latter option is less efficient. Furthermore, it prohibits attempts at writing lock-free data structures. |
Another relevant issue here arises from ideas contained in the paper:
In this paper, a property
In general, I think it makes sense to think about these accessibility predicates more like "ownership" predicates. Potentially we might want to separate out reading / writing as well, though I think writing is the most important. Using this, we can further restrict what is permitted within an |
Given the introduction of lifetimes (#642) and some potential solutions for ownership (#646), I'm starting to think again about concurrency. In particular, the question is: what primitive could we add that would support concurrency?
The chosen primitive should allow one to write locks, mutexes, shared channels, etc. One options would be to support atomic blocks or atomic instructions. An interesting observation is the support for this provided by LLVM and C++:
http://llvm.org/docs/Atomics.html
http://en.cppreference.com/w/cpp/atomic
http://en.cppreference.com/w/cpp/atomic/atomic
Anyhow, just a thought at this stage. Other notes:
https://docs.oracle.com/javase/specs/jls/se8/html/jls-17.html
https://preshing.com/20130618/atomic-vs-non-atomic-operations
https://homes.cs.washington.edu/~djg/papers/atomjava_tr_may06.pdf
http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.221.900&rep=rep1&type=pdf
https://onlinelibrary.wiley.com/doi/pdf/10.1002/cpe.635
The text was updated successfully, but these errors were encountered: