Lemmy: Bestiverse
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
RSS BotMB to Lobste.rsEnglish · 27 days ago

Why false sharing alignment should be 128 bytes on x64

monoid.github.io

external-link
message-square
0
link
fedilink
1
external-link

Why false sharing alignment should be 128 bytes on x64

monoid.github.io

RSS BotMB to Lobste.rsEnglish · 27 days ago
message-square
0
link
fedilink
False Sharing Alignment
monoid.github.io
external-link
What is false sharing What is false sharing? When CPUs and their cores read and update atomic variables, special hardware protocols make it correct and efficient, while keeping each core’s caches consistent. The coordination doesn’t happen per-address: these protocols work on cache-line-sized chunks. What happens when two atomic variables happen to reside on the same cache line? For example: an array of atomics where each atomic is used by a separate thread (e.g. per-thread counters); a queue with two atomic pointers where a writer updates the tail and a reader updates the head. Of course, you declare both pointers in the same struct and they have adjacent addresses! Each update operation makes the cache line dirty and requires coordination between CPUs. The CPUs are essentially playing ping pong with the chunk of memory.

Comments

alert-triangle
You must log in or # to comment.

Lobste.rs

lobsters

Subscribe from Remote Instance

You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !lobsters@lemmy.bestiver.se
lock
Community locked: only moderators can create posts. You can still comment on posts.

RSS Feed of lobste.rs

Source of the RSS Bot

Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 35 users / day
  • 130 users / week
  • 407 users / month
  • 1.7K users / 6 months
  • 2 local subscribers
  • 391 subscribers
  • 15.2K Posts
  • 1.05K Comments
  • Modlog
  • mods:
  • patrick
  • RSS Bot
  • BE: 0.19.15
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org