You want common, persistent memory across all processes? The Environment Variable suggestion is a good one, but if you need fast access to larger memory arrays it has its limits.
I don't know Mason, but IIWM, I'd use Shared Memory (SYSVSHM, in BSD parlance). Look up shmget, shmread, shmwrite. The tricky parts are:
- figuring out how to pass the memory pointer handle to each process
- write-locking the memory
I always write code for webservers I have control of (!), so I can usually simplify the first problem because I can force my allocation to occur before anyone else's, assuring me of a known location. However, if you can get your sysadmin to allow you to allocate a small known mailbox location as the first SHM allocation, then you can use that location as the place to store your application's larger variable array. Failing the availability of this, you can always use a file in a known location. Once this is cached, the performance hit isn't too bad.
SHM is a powerful tool!
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.