• Skip to main content
  • Skip to primary sidebar

Technipages

Tutorials and fixes for smartphone, gadget, and computer problems

  • Topics
    • Android
    • Browsers
    • Gaming
    • Hardware
    • Internet
    • iPhone
    • Linux
    • macOS
    • Office
    • Reviews
    • Software
    • Windows
    • Definitions
  • Product Reviews
  • Downloads
  • About
What Is Shared Memory?

What Is Shared Memory?

November 19, 2022 by Mel Hawthorne Leave a Comment

Modern computers have a lot of memory. Each CPU has its cache, and each running program gets assigned its portion of system RAM. There are many different ways this memory can be used and assigned. Shared memory is a concept that affects both CPU caches and the use of system RAM in different ways.

Shared Memory in Hardware

Most modern CPUs have three cache tiers, referred to as L1, L2, and L3. L1 is the smallest and fastest cache, while L3 is the largest and slowest. However, all of them are faster than accessing the main memory, making the hit rate critical to performance. Many factors make the L1 cache faster than L3. First of all, L1 memory cells are physically bigger. There are also fewer of them, and they’re located much closer to the CPU core, often within it.

Placing a cache block within the die area of a core comes with extra complexity on multicore CPUs. At this point, you can choose to have a cache in each core or outside of the cores, specifically between them. Each has its benefits and drawbacks.

Placing a cache in a core minimizes access latency, but it also means that each core needs its cache. This means that you may end up with duplicated cache lines in the L1 caches of different cores, reducing cache space efficiency. This is called a local cache, and while it’s great for access time, it’s less efficient in cache space usage and requires extra overhead in terms of cache coherency.

A shared cache is a cache that is available to multiple or all cores in a multicore CPU. A shared cache means multiple cores can access one instance of specific data, limiting wasted space due to duplication. It also means that one core can temporarily claim more than its fair share of the cache space if it needs it, while the other cores do not. It does come at the cost of increased access time.

Shared Caches in Practice

Modern CPUs use both concepts, with each core having a local L1 cache. L3 cache tends to be shared between many cores, though sometimes not all. L2 varies but can be local or shared depending on the specific CPU generation architecture.

Tip: For chiplet CPUs like high-end AMD Ryzen models, caches may be shared between all cores on a chiplet rather than with all cores in the whole CPU. It doesn’t matter how many cores a cache is shared between; even if it’s just two, it is still a shared cache, though it can be worth highlighting that it’s only partially shared.

Note: System RAM can also be shared between multiple physical CPUs on a single motherboard or between nodes in a multi-CPU system.

Shared Memory in Software

In modern computers, the software doesn’t get to address physical memory directly. Instead, it is assigned a virtual address segment, and the computer translates these virtual addresses to the physical addresses as needed. This helps to isolate memory for individual processes, which is helpful for security.

In some cases, it may be desirable to transfer data in memory from one process to another. The most efficient way to do this is to allow the two processes to share memory space. In this way, both processes can read the same data and communicate with each other. This also helps to use system RAM efficiently as the data isn’t duplicated.

Software-shared memory will typically be achieved by keeping one physical copy of the data and mapping access to it via virtual memory for each process that needs access to it.

Conclusion

Shared memory is the concept of having one section of memory accessible by multiple things. This can be implemented in both hardware and software. CPU cache may be shared between multiple processor cores. This is especially the case for higher tiers of CPU cache. The system memory may also be shared between various physical CPUs in a single larger system.

In software, shared memory can allow IPC Inter-Process Communication. One process allocates memory as shared with one or more specific processes. Those other processes can then access that memory location via virtual memory mapping. Shared memory helps ensure efficient use of memory space by avoiding data duplication in a limited space.

You Might Also Like

  • Office 365: How to Add a Shared Calendar
    Office 365: How to Add a Shared Calendar
  • Fix Microsoft Teams: Can't See Shared Screen on PC
    Fix Microsoft Teams: Can't See Shared Screen on PC
  • Office 365: Unable to Access Shared Mailbox
    Office 365: Unable to Access Shared Mailbox
  • Fix: Outlook Failed to Connect You to Shared Calendar
    Fix: Outlook Failed to Connect You to Shared Calendar
  • Dropbox: How to Disable the Weekly Shared Folder Activity Email
    Dropbox: How to Disable the Weekly Shared Folder Activity…
  • Windows: Fix ‘Multiple connections to a server or shared resource by the same user’ Error
    Windows: Fix ‘Multiple connections to a server or shared…

Filed Under: Hardware

Reader Interactions

Did this help? Let us know!

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Recent Posts

  • How to Fix Explorer.exe: Class Not Registered Error in Windows 11
  • How to Fix Explorer.exe Doesn’t Load at Startup Issue
  • How to Enable/Disable Efficiency Mode in Windows 11
  • How to Create and Edit a Playlist on YouTube Music
  • Microsoft Edge Collections: What It is and How to Use It
  • YouTube Premium: How to Disable/Enable Background Playback
  • How to Update Apps on iPad (iPadOS 16.3.1)
  • How to Fix Outlook Rules Are Not Supported for This Account

Who’s Behind Technipages?

Baby and Daddy My name is Mitch Bartlett. I've been working in technology for over 20 years in a wide range of tech jobs from Tech Support to Software Testing. I started this site as a technical guide for myself and it has grown into what I hope is a useful reference for all.

You May Also Like

  • Bubble Memory
  • Paging Memory
  • Random Access Memory (RAM)

© Copyright 2023 Guiding Tech Media · All Rights Reserved · Privacy