-
Notifications
You must be signed in to change notification settings - Fork 4
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
Relax restrictions on rvalues in atomic sections #147
Comments
Agree with this.
…On Monday, 20 February 2017, Matt Windsor ***@***.***> wrote:
Currently any atomic assignment must be either:
- an assign to a thread lvalue from a shared lvalue or symbol (array
indices and symbol parameters may be thread expressions, but nothing
else); *or*
- an assign to a shared lvalue from a thread expression (cannot name
shared variables at all).
These are arbitrary restrictions I put in place originally to ensure
Starling, back before arrays and symbols, had a RISC-style load–store
semantics to its atomic commands. The idea was that anything more
complicated would need to be entered in as a custom command, making
Starling atomics behave very much like processor atomics.
However, since we've now introduced inline conditionals into atomics in
#142 <#142>, we're taking a
more freeform approach to what can be modelled in Starling's atomics. Also,
until true custom commands are in place, the current system of hard-coded
strongly typed shorthands like CAS and ++ is inflexible and brittle.
There isn't any deep reason why these restrictions are here, and they've
already resulted in needing to write some fairly janky code to get around
them, so I propose we lift them and instead have atomic commands be
assignments to any lvalue from any rvalue over both shared and thread
environments.
Local commands will continue to be thread environment only, because the
assumption that locals are atomic in the meta-theory is based entirely on
the inability to observe one thread's locals from another.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#147>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AANd9mu7Eg_j_e1YZL3hvvPMJw1YAyq7ks5redABgaJpZM4MGdYT>
.
|
Example (though this is predicated on merging #142): in
With this change we could write
which is closer to the actual CAS semantics. |
MattWindsor91
added a commit
that referenced
this issue
Mar 8, 2017
This fixes #147 and does a bit more, getting rid of some now-unnecessary stored commands.
MattWindsor91
added a commit
that referenced
this issue
Mar 9, 2017
This fixes #147 and does a bit more, getting rid of some now-unnecessary stored commands.
MattWindsor91
added a commit
that referenced
this issue
Mar 13, 2017
This fixes #147 and does a bit more, getting rid of some now-unnecessary stored commands.
MattWindsor91
added a commit
that referenced
this issue
Apr 19, 2017
This fixes #147 and does a bit more, getting rid of some now-unnecessary stored commands.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently any atomic assignment must be either:
thread
lvalue from ashared
lvalue or symbol (array indices and symbol parameters may bethread
expressions, but nothing else); orshared
lvalue from athread
expression (cannot nameshared
variables at all).These are arbitrary restrictions I put in place originally to ensure Starling, back before arrays and symbols, had a RISC-style load–store semantics to its atomic commands. The idea was that anything more complicated would need to be entered in as a custom command, making Starling atomics behave very much like processor atomics.
However, since we've now introduced inline conditionals into atomics in #142, we're taking a more freeform approach to what can be modelled in Starling's atomics. Also, until true custom commands are in place, the current system of hard-coded strongly typed shorthands like
CAS
and++
is inflexible and brittle.There isn't any deep reason why these restrictions are here, and they've already resulted in needing to write some fairly janky code to get around them, so I propose we lift them and instead have atomic commands be assignments to any lvalue from any rvalue over both shared and thread environments.
Local commands will continue to be thread environment only, because the assumption that locals are atomic in the meta-theory is based entirely on the inability to observe one thread's locals from another.
The text was updated successfully, but these errors were encountered: