2012/2/9 Sebastian E. Ovide <sebastian.ov...@gmail.com>: > That is a nice trick for sharing information with different processes > reducing to the minimum the FS IO... It still has the IO bottleneck of > read/write from/to file compare with real data permanent in memory... but > still a valid approach...
On a generic posix system you have to use MAP_ANONIMOUS to avoid that on linux if you have lots of physical RAM setting the MAP_SHARED flag should be enough. The problem with MAP_ANONYMOUS is that you cannot share after fork. http://www.kernel.org/doc/man-pages/online/pages/man2/mmap.2.html If you are on Linux here you find some quick explanation how mmap, tmpfs and shm fs relate to each others: http://stackoverflow.com/questions/904581/shmem-vs-tmpfs-vs-mmap