I have a CLI script that loads about 1GB of data (from the database) into memory that it will then use to READ ONLY from. I want to run 6 instances of this script (to use 6 cores simultaneously) but every time I run the script it dedicates another 1GB of memory. I want to fork() and let children use the same shared memory for read-only. Having 16GB of memory I can run them all using their own memory allocations. But eventually the requirement will grow higher than I can allocate.
So, is it possible to, say, create a “static” array, fork, and allow the children to use the shared memory for processing.
Try functions
shmop_*()likeshmop_open()…