-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Go: Memory Model entry file #1435
Conversation
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.
@ethersea I did a first review and left a few comments for you.
@@ -0,0 +1,73 @@ | |||
--- | |||
Title: 'Go: Memory' | |||
Description: 'The Go memory model specifies the rules for how memory is accessed and modified in concurrent programs. It allows for the concurrent execution of multiple threads and includes operations such as reading, writing, allocating, and freeing memory. ' |
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.
The description could be shorter. I'd remove the second sentence and incorporate the information in the first paragraph of the article proper.
Subjects: | ||
- 'Computer Science' | ||
- 'Developer Tools' | ||
|
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.
Remove the extra line breaks between sections in the metadata.
- 'paths/computer-science' | ||
--- | ||
|
||
# Go: Memory Model |
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.
Remove this header. The title in the metadata will be the title when the article is published. H1 headers should not be used in the article body.
|
||
In Go, there are several basic operations that can be performed on memory: | ||
|
||
1. **Reading**: This operation involves accessing a memory location and obtaining the value stored at that location. For example: |
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.
I think this would be laid out better if headers were used instead of the list you're using now. i.e.
### 1. Reading
This operation involves accessing a memory location and obtaining the value stored at that location...
### 2. Writing
This operation involves storing a value in a specific memory location...
etc.
|
||
## Memory Model | ||
|
||
The Go memory model is a set of rules that dictate how memory operations can be performed in a concurrent program. These rules specify the order in which memory operations must be performed and how they can be observed by different threads. |
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.
Can we go into a little more details about what the rules are?
@SSwiniarski hello, sorry, I've made all changes that you requested but I'm having a hard time pushing them. Can I create a new PR? |
@ethersea what problems are you having? Maybe someone on the team can help you. |
@SSwiniarski I've pulled the updates to my local branch, but it still giving me this error when I'm trying to push. do I have to rebase my separate branch to local main? |
Co-authored-by: SSwiniarski <[email protected]>
@ethersea, were you able to resolve your problems? |
@ethersea @SSwiniarski I'll take a look at this PR and help push up some changes. Please let me know if this is not ideal, otherwise, I'll continue with getting this entry up to standards for merge! |
content/go/concepts/memory/memory.md
Outdated
|
||
## Ordering of Memory Operations | ||
|
||
However, the Go memory model also requires that certain memory operations be performed in a specific order to ensure that the program behaves correctly. For example, a write operation must occur before a read operation which depends on the written value. |
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.
However, the Go memory model also requires that certain memory operations be performed in a specific order to ensure that the program behaves correctly. For example, a write operation must occur before a read operation which depends on the written value. | |
The Go memory model also requires that certain memory operations be performed in a specific order to ensure that the program behaves correctly. For example, a write operation must occur before a read operation which depends on the written value. |
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.
LGTM cc: @SSwiniarski
👋 @ethersea |
@ethersea, congrats on your new contribution! You can see the live entry here: https://www.codecademy.com/resources/docs/go/memory It appears that you're anonymous: If you want to be credited follow the instructions below to add your GitHub username to your Codecademy profile. If not, there is nothing more you need to do. To add your GitHub username to your Codecademy profile: 2.) Then log out and log back into Codecademy using your GitHub login: |
* Add Go Memory Model entry file * Update content/go/concepts/memory/go-memory.md Co-authored-by: SSwiniarski <[email protected]> * Fix tests * Reword beginning of paragraph --------- Co-authored-by: SSwiniarski <[email protected]> Co-authored-by: Christine Yang <[email protected]>
Description
This pull request adds a new markdown file to Codecademy Docs that provides an overview of the Go Memory Model and Memory Operations. The file can be found at content/go/concepts/memory/go-memory.md.
This pull request also closes issue #943.
Type of Change
Checklist
main
branch.