0% found this document useful (0 votes)
28 views2 pages

Shared Memory Programming Overview

The document discusses shared-memory programming, highlighting its architecture where processors access shared memory locations. Key issues such as access control, synchronization, protection, and security are addressed, along with the classification of systems into uniform memory access (UMA) and non-uniform memory access (NUMA). It explains how access control models manage resource access and the implications of synchronization and protection in shared-memory systems.

Uploaded by

Ramesh B
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views2 pages

Shared Memory Programming Overview

The document discusses shared-memory programming, highlighting its architecture where processors access shared memory locations. Key issues such as access control, synchronization, protection, and security are addressed, along with the classification of systems into uniform memory access (UMA) and non-uniform memory access (NUMA). It explains how access control models manage resource access and the implications of synchronization and protection in shared-memory systems.

Uploaded by

Ramesh B
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

shared-memory Programming

A shared memory model is one in which processors connects by reading and writing locations
in a shared memory that is similarly applicable by all processors. Each processor can have
registers, buffers, caches, and local memory banks as more memory resources. Some basic
issues in the design of shared-memory systems have to be taken into consideration. These
involves access control, synchronization, protection, and security.

Access control specifies which process accesses are achievable to which resources. Access
control models create the needed check for each access request issued by the processors to
the shared memory, against the contents of the access control table. The latter contains flags
that decide the legality of each access attempt. If there are access attempts to resources,
then until the desired access is finished, all disallowed access attempts and illegal processes
are blocked. Requests from sharing processes can modify the contents of the access control
table during execution.

The flags of the access control with the synchronization rules specifies the system’s
functionality. Synchronization constraints limit the time of access from sharing processes to
shared resources. Appropriate synchronization provides that the data flows properly and
provides system functionality.

Protection is a system feature that avoids processes from creating arbitrary access to
resources belonging to other processes. Sharing and protection are incompatible; sharing
enable access, whereas protection confine it.

The simplest shared memory system includes one memory module that can be created from
two processors. Requests appear at the memory module through its two ports. An arbitration
unit within the memory module passes requests through to a memory controller.

If the memory module is not busy and a single request arrives, then the arbitration unit
passes that request to the memory controller, and the request is granted. The module is
placed in a busy state while a request is being serviced. If a new request arrives while the
memory is busy servicing a previous request, the requesting processor may hold its request
on the line until the memory becomes free or it may repeat its request sometime later.

A shared memory system leads to systems that can be classified as uniform memory access
(UMA), non-uniform memory access (NUMA), and cache-only memory architecture (COMA).

In the UMA system, shared memory is accessible by all processors through an interconnection
network in the same way a single processor accesses its memory. Therefore, all processors
have equal access time to any memory location. The interconnection network used in the
UMA can be a single bus, multiple buses, a crossbar, or a multiport memory.

In the NUMA system, each processor has part of the shared memory attached. The memory
has a single address space. Therefore, any processor could access any memory location
directly using its real address. However, the access time to modules depends on the distance
to the processor. This results in a non-uniform memory access time.

Common questions

Powered by AI

Synchronization in shared-memory systems refers to mechanisms that coordinate the timing of multiple processes accessing shared resources, ensuring that data consistency and system functionality are maintained . Protection, on the other hand, is a system feature designed to prevent unauthorized access to resources by unconfirmed processes . The potential conflict arises because synchronization typically involves sharing and coordinating access to resources, whereas protection involves restricting access. This inherent contradiction requires a sophisticated balance within system design, as effective synchronization may impede protective measures and vice versa.

In Uniform Memory Access (UMA) systems, all processors have equal access time to any memory location through an interconnection network. This could be configured using a single bus, multiple buses, crossbar, or multiport memory . In Non-Uniform Memory Access (NUMA) systems, each processor has its part of the shared memory attached, and access time to memory modules depends on the distance to the processor . Therefore, unlike UMA, access time in NUMA is not uniform.

In a simple shared-memory system, an arbitration unit is responsible for managing simultaneous access requests to a memory module from multiple processors. If the memory module is free and a request from a processor arrives, the arbitration unit forwards the request to the memory controller and sets the module to a busy state . If another request arrives while the memory is busy, the processor can either hold its request until the module is free or reissue the request later . The arbitration unit thus ensures orderly processing of requests to maintain system functionality.

When a memory module enters a 'busy state' in a shared-memory system, it means that it is currently servicing a request, and cannot immediately handle additional requests . This can lead to processors needing to hold their requests or reattempt accesses later, potentially causing delays in processing and reduced system performance, particularly if multiple processors contend for memory access frequently . Such delays could degrade the overall operability of the system if not efficiently managed by the arbitration unit and memory controller.

The implementation of a single address space in NUMA systems allows processors to access any memory location directly using its real address, facilitating data exchange and resource sharing among processors . This design aids in ensuring system coherence and makes programming easier, as developers can reference memory locations uniformly across the system without needing to account for individual memory modules or processor-specific constraints.

Access control models in shared-memory systems ensure authorized access by maintaining an access control table that contains flags determining the legality of each access attempt. These models create necessary checks for each access request issued by processors against the contents of this table . When disallowed access attempts occur, they are blocked until the legal process is completed . The system's functionality is further specified by these flags alongside synchronization rules, which help manage the timing and order of access attempts.

The design of shared-memory systems faces core challenges including access control, synchronization, protection, and security. Access control dictates which process accesses are permitted, requiring checks against an access control table that may be modified by sharing processes . Synchronization constraints ensure proper timing of access to shared resources, allowing for correct data flow and system functionality . However, these challenges are often in conflict; for example, sharing requires enabling access, whereas protection aims to confine access, representing an inherent incompatibility . Balancing these requirements is a key challenge in the system design.

Improper synchronization in shared-memory systems can lead to several risks, such as data races, where multiple processes simultaneously access shared data leading to inconsistent or erroneous outputs . It can also cause deadlocks, where processes become stuck waiting for each other to release resources, effectively halting system operations. Furthermore, it can result in priority inversion, where lower-priority processes hold resources required by higher-priority ones, disrupting the expected performance and order of execution . Proper synchronization mechanisms are critical to avoid these risks and ensure stable system operation.

Strategies to address latency issues in NUMA systems include optimizing memory allocation by placing frequently accessed data closer to the respective processing units to minimize access time . Additionally, implementing processor-affinity techniques can help ensure that tasks are executed on processors closer to where the needed data resides, reducing the latency that can occur due to memory distance . Load balancing and effective use of caches also help mitigate delays by distributing data requests more evenly across the system's memory resources.

Cache-only memory architecture (COMA) differs from traditional shared-memory systems by using the local caches of processors as the primary form of memory. This can lead to more efficient data access patterns and minimize the need for external memory access . The potential advantages of COMA include reduced latency and improved scalability, as processors leverage their caches to manage data more locally, thus reducing bottlenecks associated with centralized memory systems like UMA or NUMA . However, COMA also requires sophisticated cache coherence protocols to manage data consistency effectively.

You might also like