Location of POSIX shared memory on Mac OS
Hi All,
I am using shared memory in my application. On linux POSIX shared memory file is created at /dev/shm, but on Mac OS i am not able to find the /dev/shm. So I have few queries regarding the location of POSIX shared memory on Mac OS: 1. Is POSIX shared memory on Mac OS is stored as file(Just like at /dev/shm on Linux)?If Yes, Which location? 2. How POSIX shared memory implementation on Mac OS is different from Linux? Thanks & Regards, Vinay |
What do you mean by 'shared memory file'? Shared memory is in memory, not file...
|
Quote:
2), but I have some expirience of shm under Mac OS, maybe helpful for you. 3), I offten use filemapping under Mac OS instead of shm, it is work stable, and simpler than shm under Mac OS. : ) |
Quote:
most UNIXs not need do like that (such as freebsd which is the kernel for original Mac OS). but for shm under Mac OS, truly need solving some issues which not occurs under Linux, they are truly difference. so I often use filemapping instead of. : ) |
Checked my /dev/shm/ directory, it is full empty (Debian/linux 6.0.5; uname -r = 3.3.7; ipcs -m | wc -l = 21)
|
Thanks for your reply.
@gchen: Yes. In FreeBSD also /dev/shm doesn't exist. Can you plz provide me some details about where it is stored in FreeBSD or If it is not stored as the file, then how it handled(Is it stored in some shared memory space may be maintained by kernel where users cannot access)? @NevemTeve: In Linux, each POSIX Shared memory or Semaphore created is stored as file under /dev/shm directory. Regards, Vinay |
Quote:
Don't know whether this contributes to your question, but it seemed worth pointing out. --- rod. |
Quote:
2nd, For the named object(such as shm), it has an ID (or a string under Windows OS) which defined by user, and should be knowned by the processes which will use it. And another none-relative processes need not know it. 3nd, many UNIXs implenment "/dev/shm/*", it is only for making monitoring or administration easier. It (/dev/shm/*) is not required by the processes which will use shm. : ) |
All times are GMT -5. The time now is 11:08 PM. |