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

Proper README. #1

Merged
merged 1 commit into from
Aug 4, 2023
Merged

Proper README. #1

merged 1 commit into from
Aug 4, 2023

Conversation

lyrm
Copy link
Collaborator

@lyrm lyrm commented Jul 31, 2023

No description provided.

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@polytypic
Copy link
Collaborator

This looks basically good to me.

The README explains what things can go wrong with a backoff, which is a good thing to mention, and it mentions that backoff can reduce contention. It might be useful to slightly expand on how contention forms (i.e. quadratic amount of shared memory traffic caused by cache invalidations) and how backoff reduces such contention, which is by forming a kind of "queue" such that not all retry at the same time (kind of like an application of probabilistic sleep sort) so that people not already familiar with backoffs could also understand when it makes sense to use a randomized exponential backoff.

@lyrm
Copy link
Collaborator Author

lyrm commented Aug 3, 2023

For contention is this enough ?

Contention is what happens when multiple CPU cores try to access the
same locations in parallel. Let's take the example of multiple CPU
cores trying to perform a CAS on the same location at the same time.
Only one is going to success at each round of retries. By writing on a
shared location, it invalides all other CPUs' caches. So at each round
each CPU will have to read the memory location again, leading to
a potential quadratic O(n²) bus traffic.

Or should I do something more details ? (In this case, should I (and can I) directly take your paragraph in your kcas bloc post ?

(I am also working on a paragraph about the exponential part of exponential backoff :p)

@polytypic
Copy link
Collaborator

That paragraphs looks good to me. You could then continue by explaining that with the exponential backoff the CPUs will then not all attempt to perform the CAS at the same leading to reduction in the amount of bus traffic.

@polytypic
Copy link
Collaborator

Should we also include e.g. .prettierrc for automated formatting of the markdown?

@lyrm
Copy link
Collaborator Author

lyrm commented Aug 3, 2023

Yes, I am going to set it up.

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
Copy link
Collaborator

@polytypic polytypic left a comment

Choose a reason for hiding this comment

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

I added a couple of minor nits and there is the comment about explaining contention and how backoff helps with that, but this looks good, so I'll mark this as approved. Feel free to merge once you feel done. We can always fine tune things later.

Also, would be great to get a release out soon on opam, so we can then remove the backoff from Kcas and Saturn and use this library!

@lyrm
Copy link
Collaborator Author

lyrm commented Aug 3, 2023

I will finish that tomorrow morning 👍 Thanks.

@polytypic
Copy link
Collaborator

Speaking of using this library, I already created a draft PR to Kcas to use backoff from this library, during which I noticed that OCaml 4 is not supported.

@lyrm lyrm force-pushed the README branch 3 times, most recently from 26814ac to 0af2a1e Compare August 4, 2023 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants