Skip to content

Add new section "Shared Resources" and "Lock-Free" #15

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

Merged
merged 1 commit into from
Jul 22, 2024

Conversation

weihsinyeh
Copy link
Collaborator

  1. Align with Chapter 5's perspective on Shared Resources.
  • Expand from the programmer's view in Chapter 5, focused on a cache-line perspective in this section.
  1. In this section, understand that shared resources at the cache-line level involve issues related to data transfer across chips.
  • Move "Cache effects and false sharing" to Section 6: Shared Resources.
  1. Address false sharing issues within shared resources.

  2. Proceed to bottleneck issues in shared resources due to communication.

  • Discuss how cache coherence limits the scalability of spin locks, connecting to the problems caused by blocking in the next chapter, and preparing for the discussion of lock-free mechanisms later on.

@jserv jserv changed the title Add a new section Shared Resources. Add a new section "Shared Resources" Jun 28, 2024
Copy link
Contributor

@jserv jserv left a comment

Choose a reason for hiding this comment

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

  1. Squash the commits for reviewing.
  2. Check https://cbea.ms/git-commit/ carefully and refine the git commit messages.
  3. Always use lowercase filenames.

@weihsinyeh weihsinyeh changed the title Add a new section "Shared Resources" Add new section "Shared Resources" and "Lock Free" Jul 7, 2024
then the second thread locks another mutex and subsequently attempts to lock the mutex held by the first thread.
At the same time, the first thread also tries to lock the mutex held by the second thread.
Then the deadlock occurs.
Therefore, we can see that deadlock happens when different threads lock in incompatible orders,
Copy link
Contributor

Choose a reason for hiding this comment

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

Proofread as following:

Therefore, we can see that deadlock occurs when different threads acquire locks in incompatible orders, leading to system immobilization as threads perpetually wait on each other.

@jserv jserv changed the title Add new section "Shared Resources" and "Lock Free" Add new section "Shared Resources" and "Lock-Free" Jul 21, 2024
Copy link
Contributor

@jserv jserv left a comment

Choose a reason for hiding this comment

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

Rebase the latest main branch.

Expand the shared resources from the programmer's view in "Read Modify
Write" to the cache-line perspective in section "Shared Resources".

Move the original "Cache effects and false sharing" to "Shared
Resources". Add an explanation of how the scalability of locks will be
limited by cache coherence.

Change the title of Section "Atomic operations as building blocks" to
"Concurrency tools and synchronization mechanisms". Introduce a blocking
mechanism with its issues, including waiting times, deadlock, and
scalability. Give an example of how synchronization without using a lock
can also lead to a livelock.

Introduce the three types of progress, which are wait-free, lock-free,
and obstruction-free.

 - Add a figure containing three tables showing the progress of every
thread and the progress of the overall system.

Give a SPMC problem to explain how to achieve fully lock-free by using
algorithms and data structure designs with appropriate synchronization
mechanisms and concurrency tools.

 - Add two flowcharts: one for "lock-based" solution 1 and another for
"lock-based and lock-free" solution 2 and a diagram illustrating
different data structures to show different data structures.
@jserv jserv merged commit d4c5b42 into sysprog21:main Jul 22, 2024
@jserv
Copy link
Contributor

jserv commented Jul 22, 2024

Thank @weihsinyeh for contributing!

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