Skip to main content
The 2024 Developer Survey results are live! See the results

Questions tagged [shared-memory]

Memory that may be simultaneously accessed by multiple programs

0 votes
0 answers
13 views

Why can't a shared memory file locked by flock() be unlocked automatically when closing the file descriptor?

This snippet is designed to lock a shared memory file by flock() for 10 seconds and then release the lock. I ran it on two terminals to test if the lock is effective. void main(void) { int fd = ...
apple's user avatar
  • 1
0 votes
0 answers
15 views

How to use shm_open() with a Unique Filename (or alternatives)

I am writing a set of programs on Linux that use shared memory. Currently I call shm_open() with a predetermined name for the shared memory. This works fine as I currently only have one set of ...
GrapefruitIsAwesome's user avatar
1 vote
1 answer
90 views

How can decrease time of creating and insert in boost::interprocess::map?

In the below code I unpack a msgpack file to std::map. The duration of this process is almost 85 seconds. #include <map> #include <vector> #include <string> #include <iostream> ...
Alireza Abbasi's user avatar
1 vote
1 answer
49 views

--shm_size change for Docker in Nextflow pipeline: containerOptions not seeming to work

I am trying to increase the shared memory size for the Docker image being used to run a Nextflow pipeline. Per some indications online, I have added the following to my config file: docker { ...
ekofman's user avatar
  • 419
0 votes
1 answer
29 views

How should I initialize pthread mutexes in shared memory, since at program start they can be already initialized?

I'm using shared, robust pthread mutexes to protect some shared memory areas I have in my application. Since my program is managed by a systemd service, it could potentially be restarted, in which ...
Alessandro Bertulli's user avatar
2 votes
1 answer
85 views

Multiprocessing shared memory to pass large arrays between processes

Context: I need to analyse some weather data for every hour of the year. For each hour, I need to read in some inputs for each hour before performing some calculation. One of these inputs is a very ...
blyatman's user avatar
0 votes
1 answer
30 views

How does mmap'ed eBPF map shared between processes synchronizes operations?

It's possible to mmap eBPF map of type BPF_MAP_TYPE_ARRAY. I have a configuration where multiple processes access this mmaped map that contains entries of type "some cacheline-sized struct" ...
blonded04's user avatar
  • 463
0 votes
0 answers
21 views

How to share a matrix in shared memory across multiple users using R/bigmemory

I have a matrix in shared memory that I want to access (read-only) by multiple users using R/bigmemory. Is it possible and how? I tried to change the rights of the files in shared memory, but it's not ...
Matthias Munz's user avatar
0 votes
0 answers
61 views

Is there a way to write an image to memory with Python and read it from another application written in C++?

I would like to create and write an image to the memory in such a way that other processes are able to read it. The goal is to have a Python script create some graph using matplotlib.pyplot, write it ...
Falesz's user avatar
  • 17
1 vote
2 answers
92 views

Error with operations on the elements in shared memory C

I made this code that inserts a structure into shared memory. I made debug prints to try to figure out where the processes were stopping and why there was an error. Apparently by doing operations on ...
MiusiZ's user avatar
  • 203
1 vote
0 answers
91 views

Problem with malloc and shared memory in C

I am trying to put shared_pid_data in shared memory. I need to have a dynamic array, so I use malloc, I also tried using calloc getting the same result. The problem I am encountering is that the data ...
MiusiZ's user avatar
  • 203
0 votes
0 answers
40 views

Registering POSIX-CPU shared memory to CUDA with cudaHostRegister

Hardware: I am using a Jetson AGX Orin. I am trying to set an IPC between multiples processes to stream a video. I use a classic shm_open/mmap shm mechanism, then I try to map it on CUDA with pinned/...
Karim Dhrif's user avatar
2 votes
1 answer
30 views

Should I handle the memory order when using Posix-MQ and SHM within multi-processes?

I'm using a block of SHM to sharing data within multiple Linux processes. When the producer put some data into the SHM, it sends a message to the consumer through a Posix-MQ. This message carries a ...
Leon's user avatar
  • 1,997
0 votes
1 answer
87 views

Accessing X11 window pixel data over shared memory

I am writing a program in which I need to access a X11 window's pixel data as efficiently as possible, ideally over shared memory, without needing to make XCB calls every time I want to refresh the ...
Etienne Perot's user avatar
1 vote
2 answers
121 views

active waiting in the main process C

I made this code in C that allows me to create a secondary process that does certain things. The main process has to wait until the other process is ready before starting with program execution. For ...
MiusiZ's user avatar
  • 203

15 30 50 per page
1
2 3 4 5
213