Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Wow, thanks for the "big picture".
The reason I am toying with it, is because in the Advanced Linux Programming Guide, it says that shared memory segments is the fastest way to communicate between 2 processes. So I wanted to know, if Perl could setup "shared memory segments". Of course I confused things, by jumping to the conclusion that mmap meant memory mapping, and that memory mmaping files is part of that. I now see the difference. I would (from my limited knowledge) differ from you on your statement The SysVIPC (msg* functions) give you access to very small amounts of shared memory - usually only a few kilobytes. By contrast, on a 64 bit system, you could mmap in petabytes of data, and on a 32 bit system, you could mmap in gigs. According to my c experiments, each shared memory segment is limited to whats returned from getpagesize(), and on my system it is 4k. But there dosn't seem to be anything stopping one from creating and attaching to "multiple shared segemnts", and increasing it's working size. Of course you are then required to keep track of the segments yourself. Now I notice mozilla uses shared memory segments, as do a few other apps, so it must have some speed benefits over other forms of IPC. Mozilla is using 393kb, of shared memory, on my system. Now that my confusion over mmap vs. shared memory is cleared up, the original question still stands.... Can Perl create or attach to a shared memory segment, as is done in C. If I tried it from Inline::C, would Perl interfere with it's workings? I'm not really a human, but I play one on earth. flash japh In reply to Re^3: Mmap question
by zentara
|
|