Christoph Rohland; Hugh Dickins; KOSAKI Motohiro

Aus Vokipedia
Version vom 31. August 2025, 06:14 Uhr von Jacquetta0934 (Diskussion | Beiträge)

(Unterschied) ← Nächstältere Version | Aktuelle Version (Unterschied) | Nächstjüngere Version → (Unterschied)
Wechseln zu: Navigation, Suche


In laptop science, shared memory is memory which may be concurrently accessed by multiple applications with an intent to offer communication amongst them or keep away from redundant copies. Shared memory is an environment friendly technique of passing information between programs. Relying on context, applications might run on a single processor or on multiple separate processors. Using memory for communication inside a single program, e.g. amongst its a number of threads, can also be known as shared memory. In computer hardware, shared memory refers to a (typically massive) block of random entry Memory Wave Experience (RAM) that may be accessed by a number of completely different central processing units (CPUs) in a multiprocessor pc system. A shared memory system is comparatively easy to program since all processors share a single view of knowledge and the communication between processors may be as fast as memory accesses to the same location. Trying to access close by memory locations might trigger false sharing. Shared memory computers can't scale very properly.



Such cache coherence protocols can, when they work properly, present extraordinarily high-performance access to shared data between multiple processors. Then again, they can typically turn out to be overloaded and grow to be a bottleneck to performance. Applied sciences like crossbar switches, Omega networks, HyperTransport or entrance-facet bus can be used to dampen the bottleneck-effects. In case of a Heterogeneous System Structure (processor structure that integrates several types of processors, Memory Wave similar to CPUs and GPUs, with shared memory), the memory management unit (MMU) of the CPU and the input-output memory management unit (IOMMU) of the GPU must share certain characteristics, like a typical address space. The alternatives to shared memory are distributed memory and distributed shared memory, each having an analogous set of issues. CPUs and the underlying architecture is just not cache coherent. IPC by shared memory is used for example to transfer photographs between the application and the X server on Unix programs, or contained in the IStream object returned by CoMarshalInterThreadInterfaceInStream within the COM libraries below Home windows.



Dynamic libraries are usually held in memory once and mapped to a number of processes, and only pages that needed to be customized for the individual course of (as a result of an emblem resolved in another way there) are duplicated, normally with a mechanism known as copy-on-write that transparently copies the page when a write is tried, after which lets the write succeed on the non-public copy. In comparison with a number of deal with house operating techniques, memory sharing -- especially of sharing procedures or Memory Wave pointer-based mostly structures -- is simpler in single tackle space working techniques. POSIX gives a standardized API for utilizing shared memory, POSIX Shared Memory. POSIX interprocess communication (a part of the POSIX:XSI Extension) contains the shared-memory features shmat, shmctl, shmdt and shmget. Unix System V supplies an API for shared memory as effectively. This makes use of shmget from sys/shm.h. BSD programs provide "anonymous mapped memory" which might be utilized by a number of processes. It stays in the system till explicitly eliminated by a course of.



This has a downside in that if the method crashes and fails to wash up shared memory it's going to stay till system shutdown; that limitation just isn't present in an Android-particular implementation dubbed ashmem. POSIX also gives the mmap API for mapping files into memory; a mapping might be shared, permitting the file's contents for use as shared memory. Linux distributions based mostly on the 2.6 kernel and later provide /dev/shm as shared memory in the form of a RAM disk, more particularly as a world-writable listing (a directory in which every consumer of the system can create files) that is stored in memory. Each the RedHat and Debian based mostly distributions embrace it by default. Assist for this sort of RAM disk is completely non-obligatory inside the kernel configuration file. On Home windows, one can use CreateFileMapping and MapViewOfFile capabilities to map a region of a file into memory in a number of processes. Qt offers the QSharedMemory class. Different programming languages could have their very own ways of using these working services for related effect. For example, PHP offers an API to create shared memory, Memory Wave Experience much like POSIX capabilities. El-Rewini, Hesham; Abd-El-Barr, Mostafa (2005). Advanced Computer Structure and Parallel Processing. Jeffrey S. Chase; Henry M. Levy; Michael J. Feeley; and Edward D. Lazowska. Robbins, Kay A.; Robbins, Steven (2003). Unix systems programming: communication, concurrency, and threads (2 ed.). Prentice Hall PTR. p. Shared memory facility from the one Unix Specification. Christoph Rohland; Hugh Dickins; KOSAKI Motohiro. Creating Named Shared Memory from MSDN. Shared Memory Introduction, Ch. 12 from guide by Richard Stevens "UNIX Community Programming, Quantity 2, Second Edition: Interprocess Communications". SharedHashFile, An open supply, shared memory hash table.

Meine Werkzeuge
Namensräume

Varianten
Aktionen
Navigation
Werkzeuge