I'm on Linux, and I using mmap for sharing information between python code and C code. When I used this instruction:
buf = mmap.mmap(fd.fileno(), 4096, access=mmap.ACCESS_DEFAULT)
with buf:
buf.write(b'HELLO WORLD')
This is C instruction for mmap:
int *shared = mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_SHARED, fd1, 0);
I'm expecting my changes are still in the memory, but it is in a file on the disk already.
I would like that Python code write all information on the memory and C code write all information in the memory to file. Is it possible to do this?