Add "Memory consistency models" subsection to "Memory orderings" section#16
Open
yutingshih wants to merge 7 commits intosysprog21:mainfrom
Open
Add "Memory consistency models" subsection to "Memory orderings" section#16yutingshih wants to merge 7 commits intosysprog21:mainfrom
yutingshih wants to merge 7 commits intosysprog21:mainfrom
Conversation
jserv
reviewed
Jun 29, 2024
jserv
reviewed
Jun 29, 2024
jserv
reviewed
Jun 29, 2024
jserv
reviewed
Jul 1, 2024
jserv
reviewed
Jul 1, 2024
jserv
reviewed
Jul 6, 2024
jserv
reviewed
Jul 6, 2024
| \subsection{Memory consistency models} | ||
|
|
||
| When a program is compiled and executed, it doesn't always follow the written order. | ||
| The system may change the sequence and optimize it to simulate line-by-line execution, as long as the final result matches the expected outcome. |
Contributor
There was a problem hiding this comment.
You should address the impact from modern microprocessors and optimizing compilers.
jserv
reviewed
Jul 6, 2024
| When a program is compiled and executed, it doesn't always follow the written order. | ||
| The system may change the sequence and optimize it to simulate line-by-line execution, as long as the final result matches the expected outcome. | ||
|
|
||
| This requires an agreement between the programmer and the system (hardware, compiler, etc.), ensuring that if the rules are followed, the execution will be correct. |
Contributor
There was a problem hiding this comment.
Merge the statement into the previous paragraph.
jserv
requested changes
Jul 22, 2024
Contributor
jserv
left a comment
There was a problem hiding this comment.
Rebase the latest main branch.
jserv
requested changes
Jul 22, 2024
Contributor
jserv
left a comment
There was a problem hiding this comment.
Instead of git merge, do git rebase.
1. split setences into separate lines 2. change the quotation marks "..." as ``...''
- Changed "doesn't" to "does not" for formal English writing - Fixed the inconsistency of quotation marks - Merged related statements into one paragraph
jserv
reviewed
Jul 23, 2024
|
|
||
| The write order seen by one thread can differ from the order seen by other threads because write operations can be reordered during propagation. | ||
| However, reads and writes to the same memory address must still follow a total order. | ||
| Therefore, the following litmus test cannot result in \monobox{r1 = 1}, \monobox{r2 = 2}, but \monobox{r3 = 2}, \monobox{r4 = 1}. |
Contributor
There was a problem hiding this comment.
Provide some information about running Litmus tests.
jserv
reviewed
Jul 23, 2024
|
|
||
| \subsubsection{Sequential consistency (SC)} | ||
|
|
||
| In the 1970s, Leslie Lamport proposed the most common memory consistency model, sequential consistency (SC), defined as follows: |
Contributor
There was a problem hiding this comment.
Add some references at the end of this document.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request aims to enhance the comprehensiveness of the “Memory orderings” section of this book. Currently, the section primarily covers memory orders defined in C11/C++11 but lacks discussion on hardware assumptions regarding memory consistency. Thus I made the following changes: