Skip to content
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

Merged
merged 6 commits into from
Feb 24, 2023
Merged

Conversation

ethersea
Copy link
Contributor

@ethersea ethersea commented Jan 4, 2023

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

  • Adding a new entry

Checklist

  • All writings are my own.
  • My entry follows the Codecademy Docs style guide.
  • My changes generate no new warnings.
  • I have performed a self-review of my own writing and code.
  • I have checked my entry and corrected any misspellings.
  • I have made corresponding changes to the documentation if needed.
  • I have confirmed my changes are not being pushed from my forked main branch.
  • I have confirmed that I'm pushing from a new branch named after the changes I'm making.
  • Under "Development" on the right, I have linked any issues that are relevant to this PR (write "Closes # in the "Description" above).

@CLAassistant
Copy link

CLAassistant commented Jan 4, 2023

CLA assistant check
All committers have signed the CLA.

@ethersea ethersea changed the title Add Go: Memory Model entry file Go: Memory Model entry file Jan 4, 2023
@SSwiniarski SSwiniarski linked an issue Jan 5, 2023 that may be closed by this pull request
3 tasks
@SSwiniarski SSwiniarski added new entry New entry or entries go Go/Golang entries status: under review Issue or PR is currently being reviewed labels Jan 5, 2023
@SSwiniarski SSwiniarski self-assigned this Jan 5, 2023
@SSwiniarski
Copy link
Contributor

@ethersea I'll be doing a first review of this PR. Please remember to sign the CLA.

Copy link
Contributor

@SSwiniarski SSwiniarski left a 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. '
Copy link
Contributor

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'

Copy link
Contributor

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
Copy link
Contributor

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:
Copy link
Contributor

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.
Copy link
Contributor

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?

@ethersea
Copy link
Contributor Author

ethersea commented Jan 7, 2023

@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?

@SSwiniarski
Copy link
Contributor

@ethersea what problems are you having? Maybe someone on the team can help you.

@ethersea
Copy link
Contributor Author

ethersea commented Jan 7, 2023

@SSwiniarski I've pulled the updates to my local branch, but it still giving me this error when I'm trying to push.
Screen Shot 2023-01-07 at 19 04 51

do I have to rebase my separate branch to local main?

@yangc95
Copy link
Contributor

yangc95 commented Jan 7, 2023

error when I'm trying to push.

@ethersea let's' continue the conversation regarding Git issues here: #1467

@SSwiniarski
Copy link
Contributor

@ethersea, were you able to resolve your problems?

@yangc95
Copy link
Contributor

yangc95 commented Feb 13, 2023

@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!


## 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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

Copy link
Contributor

@yangc95 yangc95 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM cc: @SSwiniarski

@SSwiniarski SSwiniarski merged commit 949de73 into Codecademy:main Feb 24, 2023
@github-actions
Copy link

👋 @ethersea
You have contributed to Codecademy Docs, and we would like to know more about you and your experience.
Please take a minute to fill out this four question survey to help us better understand Docs contributions and how we can improve the experience for you and our learners.
Thank you for your help!

@SSwiniarski
Copy link
Contributor

@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:
image

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:
1.) Add your GitHub Username to your Codecademy Profile Details, you can get there on your desktop by pressing on your profile picture in the upper right-hand corner and selecting "Profile" in the drop-down box:
image

2.) Then log out and log back into Codecademy using your GitHub login:
image

@yangc95 yangc95 self-assigned this Feb 24, 2023
Pavan-Nambi pushed a commit to Pavan-Nambi/docs that referenced this pull request Apr 12, 2023
* 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Entry] Go: Memory
4 participants