|
|
|
|
|
by CyberDildonics
1613 days ago
|
|
If this example approach is "file-backed" to you, then so be it but I think you have willfully misread my comments up to here. You kept making the same claim and I asked you to explain it, then you just made the same claim again. shm_open("/TESTOBJECT" That's a file path. Maybe you just wanted to bait an argument by not explaining yourself. |
|
> shm_open("/TESTOBJECT"
>>That's a file path
Pedantically, no. It's a name (https://man7.org/linux/man-pages/man3/shm_open.3.html) that identifies a memory object that is only coincidentally also mapped to the file path "/dev/shm/TESTOBJECT" on a typical linux. shm_open() returns an "FD", though.
On Linux, as a sibling poster noted, you could also use mmap(.. MAP_SHARED | MAP_ANONYMOUS, /*fd*/ -1 ...) , which to my knowledge is entirely "file-free" by any meaning of the term "file". But then again, in my understanding this would only work with child processes because that mapping has to be inherited.
On other OSes, there may be completely different APIs to map shared memory that don't involve anything "file" like, either. Quite honestly I can't point you to any because I do only Linux and Windows, but let's just end the discussion here and let's agree that memory != file. I'm angry at myself for wasting another evening fighting a pointless discussion with somebody who would rather argue than try to get my point.