-
Notifications
You must be signed in to change notification settings - Fork 2
Feature/volatile #18
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
base: main
Are you sure you want to change the base?
Feature/volatile #18
Changes from all commits
c03f477
31413b9
d2cd2c4
a3a1696
b50cc99
db4674d
383bd13
f05221b
02efab2
ecf112a
ff6aa51
56a52af
eb38614
bec6481
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,3 +31,7 @@ | |
| *.out | ||
| *.app | ||
| build | ||
|
|
||
| *.DS_Store | ||
| *.vscode | ||
| *.dot | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| @v1 = 1; | ||
| assert(@v1 == 1); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| // This test demonstrates that volatile reads are pull actions, not push actions. | ||
| // In particular, the read of @v in t2 should not push the changes from t2 to t1, | ||
| // and so the assertion on y should always succeed. | ||
|
|
||
| @v = 0; | ||
| x = 0; | ||
| y = 0; | ||
|
|
||
| t1 = spawn { | ||
| x = 1; | ||
| @v = 1; | ||
| assert(y == 0); | ||
| }; | ||
|
|
||
| t2 = spawn { | ||
| y = 1; | ||
| if (@v == 1) { | ||
| assert(x == 1); | ||
| } else { | ||
| assert(x == 0); | ||
| } | ||
| join t1; | ||
| }; | ||
|
|
||
| join t1; | ||
| join t2; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| @v = 2; | ||
| $t = spawn { | ||
| assert(@v == 2); | ||
| }; | ||
| assert(@v == 2); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
|
|
||
| $t = spawn { | ||
| x = 1; | ||
| @v1 = 1; | ||
| }; | ||
| x = 2; | ||
| @v2 = 2; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| @v1 = 1; | ||
| assert(@v1 == 1); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| // This test demonstrates that volatile reads are pull actions, not push actions. | ||
| // In particular, the read of @v in t2 should not push the changes from t2 to t1, | ||
| // and so the assertion on y should always succeed. | ||
|
|
||
| @v = 0; | ||
| x = 0; | ||
| y = 0; | ||
|
|
||
| t1 = spawn { | ||
| x = 1; | ||
| @v = 1; | ||
| assert(y == 0); | ||
| }; | ||
|
|
||
| t2 = spawn { | ||
| y = 1; | ||
| if (@v == 1) { | ||
| assert(x == 1); | ||
| } else { | ||
| assert(x == 0); | ||
| } | ||
| join t1; | ||
| }; | ||
|
|
||
| join t1; | ||
| join t2; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| @v = 2; | ||
| $t = spawn { | ||
| assert(@v == 2); | ||
| }; | ||
| assert(@v == 2); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| @v = 2; | ||
| $t = spawn { | ||
| assert(@v == 2); | ||
| }; | ||
| assert(@v == 2); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| @v = 2; | ||
| $t = spawn { | ||
| @v = 41; | ||
| }; | ||
| assert(@v == 2); |
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Duplicate of examples/accept/semantics/branching/volatile_sync_conflict_two_vars.gm
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (Which is a bit strange since one is accept and the other is reject!) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| // The two volatile writes are releases with no intervening acquire, so they | ||
| // establish no happens-before between the x writes: x races. Eager/linear catch | ||
| // this at the write; lazy only reports conflicts on variables that are read, and | ||
| // x is never read, so lazy accepts it. | ||
| // expect branching-lazy: accept | ||
|
|
||
| $t = spawn { | ||
| x = 1; | ||
| @v = 1; | ||
| }; | ||
| x = 2; | ||
| @v = 2; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| @v = 2; | ||
| $t = spawn { | ||
| @v = 41; | ||
| }; | ||
| assert(@v == 2); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
|
|
||
| $t = spawn { | ||
| x = 1; | ||
| @v = 1; | ||
| }; | ||
| x = 2; | ||
| @v = 2; |
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Duplicate of examples/reject/semantics/linear/volatile_sync_conflict.gm |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
|
|
||
| $t = spawn { | ||
| x = 1; | ||
| @v1 = 1; | ||
| }; | ||
| x = 2; | ||
| @v2 = 2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate of examples/accept/semantics/linear/volatile_sync.gm