3,196 questions
1
vote
1
answer
60
views
C++ shared memory among forked processes (what do i do wrong)
I am making a basic program when the main process creates processes with fork that take the first element from a list and print it. I used boost library to manage shared memory, but this is my first ...
1
vote
1
answer
45
views
Shared memory among forked processes c++
I am writing a c++ program and I want a program where there are two processes (running with fork()) and they both share a common list and an interprocess mutex is there to guard the shared list ...
0
votes
0
answers
60
views
Use same shared memory unit from Lua and PHP [closed]
This code doesn't work. I set up a full fledged example based on the reading from comments by Robert who linked a lua and php discussion/documentation. Note, those are independent sources, so...
...
1
vote
0
answers
50
views
Using Transparent Huge Pages (THP) with shm_open and mmap on a Read-Only File in /dev/shm
I have a read-only file located in /dev/shm with an arbitrary size (not necessarily a multiple of 2MB or maybe smaller 120KB). I want to use shm_open and mmap to map this file into memory and then use ...
0
votes
1
answer
58
views
Can child processes create shared memory and share it with parent processes?
Can a child process create a SharedMemory object and share it with a parent process? Currently I am getting errors when I try. I need this because creating and copying memory is the major performance ...
2
votes
0
answers
50
views
linux shared memory doesn't showed as expect
I use mmap create a shared memory, two process shared the memory. I use the 'top' command to watch the shared memory output, it looks like:
1825191 root 20 0 10972 88 0 S 0.0 0.0 ...
1
vote
2
answers
33
views
conflict when using multiprocessing's share memory
I am using multiprocessing's shared memory to share a numpy array between tasks. While each task should originally just read the array, I was curious if writing was also possible. I wrote the ...
0
votes
0
answers
63
views
How to initialize values in shared memory
I am cross-compiling on a Ubuntu 24.04 host for a Raspberry Pi Zero2 W. I want to be able to access data for a device on the i2c bus not only from multiple instances in the same program but also from ...
0
votes
0
answers
81
views
How to Parallelize Nested Loops in Fortran on a Shared Memory System with OpenMP, Assigning Threads Explicitly to Inner and Outer Loops?
I am working on a Fortran program with nested loops that I want to parallelize using OpenMP. The program runs on a shared memory multi-processor system, and I want the following:
The inner loop to run ...
0
votes
1
answer
67
views
python3 multiprocessing SharedMemory can not solve connecting to existing memory
What I want to accompish is to first run testb.py and create shared memory, then run testc.py and connect to it. Then shutdown testc.py and rerun it and connect to shared memory again. But I stuck at ...
1
vote
0
answers
69
views
How to share a "global variable" from a static library across DLL's
We are working on breaking apart a large application that has a main exe plus many DLL's/so's. We want some DLL's to build independently. As part of doing this, we want to move some code from DLL's ...
2
votes
1
answer
83
views
How do I correctly determine NAME_MAX for shm_open?
In the manual page for shm_open, we see that the argument for the name parameter should be up to NAME_MAX characters long for portable use.
However, in The GNU C Library Reference Manual's section ...
0
votes
0
answers
26
views
Is it possible to achieve synchronization between main and child processes while using Boost Shared Memory? [duplicate]
I am trying to achieve a functionality that I have to maintain a Global Database, let's say a map of string object and an unique id. I have to spawn multiple process to gather the data. I decide on ...
1
vote
0
answers
106
views
multiprocessing and shared memory
I am trying to get the basics of multiprocessing in python. I have a quite complex routine that takes a large array (c.a 1Gb) and a double as inputs and returns a double. The large array is not going ...
0
votes
2
answers
112
views
Utilize multiprocessing in Python with functions that do not return any value
Consider the following codes in Python:
from multiprocessing import Pool
data = [4] * 10
def update(j):
data[j] += j ** 2
def solver():
with Pool(8) as po:
po.map(update, range(10))
...