Questions tagged [shared-memory]
The shared-memory tag has no summary.
82 questions
0
votes
0
answers
51
views
shared mem synchronization with xen
I use xen with a buildroot on the CPU0 and a baremetal written in C on the CPU1.
The arch is ARM64.
The shared mem works with 1k of pages (an array of 4096 values).
I am trying to send data from the ...
1
vote
0
answers
52
views
Ubuntu keeps remounting /dev/shm with different mounting options periodically
I have a Ubuntu 24.04.2 system where /dev/shm gets remounted (I assume) every now and then (roughly each 10 seconds), but I have no idea why. There's no mention of that mounting point in /etc/fstab ...
0
votes
1
answer
151
views
Can mmap be used to create a file which references memory subset of another file?
I'm interested in writing a program that can create two files, second file would be a "view" of first file and if modified, the first file would also be modified. Is this possible to do with ...
3
votes
1
answer
5k
views
Is it possible for two processes to use the same shared-memory without resorting to a file to obtain it, be it a memory-mapped file or /dev/shm file?
I'm curious because today the only way I know how to give two different processes the same shared-memory is through a memory-mapped file, in other words, both processes open the same memory-mapped ...
1
vote
1
answer
331
views
Using IPC_CREAT with an already created shared memory segment
I am trying to figure out what will happen if I use the IPC_CREAT flag with shmget(). I have used a key of an already created shared memory segment from another process. When I did so, the calling ...
0
votes
1
answer
570
views
shmget() and shmat()
Using shmget(), we can allocate a shared memory block of certain size in bytes and using shmat(), we attach this shared memory block to the address space of the calling process.
I need to check my ...
0
votes
1
answer
1k
views
Issues Using GPSD as Source for Chronyd
I am attempting to use a USB GPS without PPS dongle as the sole time source on Ubuntu 18.04. GPSD appears to be working correctly since cgps reports a 3D fix. However, I can't get chrony to see the ...
2
votes
1
answer
825
views
Browser (Opera, Chromium...) start causing Permission denied (13) error for shared memory
Using Manjaro / Arch linux, I wanted to install another browser. However, no matter whether I installed Opera or Chromium (via pacman) I always get an error when executing it (from both Application ...
0
votes
1
answer
983
views
Shared memory using shmget()
According to my understanding about shared memory is that it is a memory segment that is shared between two or more processes. Shared memory can be implemented using shmget() . However , since any ...
1
vote
1
answer
7k
views
How does a process and its children use memory in case of mmap()?
Let's say, we are creating a shared memory using mmap(). Let's say the total memory size is 4096. If we use a fork() system call to create children, would the children use the same memory, or will ...
0
votes
0
answers
225
views
shmat returns error (void *) -1 in selinux enabled rhel environment
as per the documentaion:-
If SHM_RDONLY is specified in shmflg, the segment is attached for reading and the process must have read permission for the segment. Otherwise the segment is attached for ...
2
votes
1
answer
240
views
Am I making invalid assumptions with regard to my kernel module's shared memory?
I have written a "device driver" (see source code here: https://bitbucket.org/wothke/websid/src/master/raspi/websid_module/ ) that runs fine for most of the time (see https://www.youtube.com/...
0
votes
1
answer
2k
views
FFmpeg cannot write file to /dev/shm: Permission Denied
Issue:
I have an FFmpeg command that I've been running for months now to stream video into the /dev/shm directory. It had been working fine until relatively recently (e.g. within a week), now it ...
0
votes
1
answer
2k
views
Do anonymous memory mapping and shared memory allocate space from physical memory only?
In Linux,
when using mmap() for anonymous memory mapping, or using malloc(), do they allocate "space" from only physical memory, or either physical memory or swap or their combination? (I ...
2
votes
1
answer
2k
views
How to revoke write permissions on a shared memory object s.t. subsequent writes to aleady mapped pages by other processes will fail?
Is there any way to revoke write permissions to shared memory by the process who created that shared object, s.t. any other process who has mapped the shared memory to its virtual space with write ...
0
votes
1
answer
1k
views
How to understand PBS output "mem" and "vmem" keep the same when the task is x-fold increased with mpirun -np x task
Here is a simple experiment I tried:
Given a task called "sim.exe" which doing a model simulation, I then use MPI to launch x "sim.exe" simultaneously on one node (shared memory system). I have tried ...
5
votes
2
answers
10k
views
Are sharing a memory-mapped file and sharing a memory region implemented based on each other?
Are sharing a memory-mapped file and sharing a memory region implemented based on each other? The following two quotes seem to say so, and seem a chicken-egg problem to me.
Operating System Concepts ...
2
votes
1
answer
983
views
Processor not seeing changes to POSIX shared memory?
Context: I am using POSIX shared memory to provide a set of processes with a shared memory space. I have used this scheme for some time now in order to share data, and it's working okay. However, I ...
1
vote
0
answers
1k
views
Two processes sharing memory under different privileged users
I have two processes sharing memory (via Boost Interprocess). Each process is run under a different user. The first process is run from one of our privileged users.
The second process is ran via a ...
2
votes
1
answer
2k
views
Change ownership of shared memory
When I run ipcs -m, I can see a list of the shared memory segments on the system, like
------ Shared Memory Segments --------
key shmid owner perms bytes nattch status
...
4
votes
1
answer
11k
views
Sharing file descriptors
If file descriptors are specific to each process (i.e. two processes may use the same file descriptor id to refer to different open files) then how is it possible to share transfer file descriptors (e....
0
votes
1
answer
788
views
Issues due to independent concurrent writes to shared memory
Actually I would like to know the issues caused by independent concurrent writes to shared memory.
To be more elobarote, consider we have three processes (proc1, proc2, proc3).
These 3 processes are ...
-2
votes
1
answer
735
views
2GB of shared memory used as shown in free [closed]
OS: Ubuntu 16.04
free output indicated about 2GB of shared memory.
The shared memory was still allocated after a logout, and no particular process from top list was occupying it.
ipcs -m did not ...
10
votes
2
answers
9k
views
Where does Linux set the default values for SHMMAX?
I'm just wondering where these values are being set and what they default to? Mine is currently 18446744073692774399. I didn't set it anywhere that I can see.
$ cat /proc/sys/kernel/shmmax
...
2
votes
0
answers
296
views
How to fetch semaphores and sharedmem objects for a specific apache instance when more than one apache instances run with the same app id on the box
Not sure if the question is pertinent for this forum.
We have a server with 3 apache instances running with the "same" app/functional ID
These instances communicate with their corresponding ...