I've been asking around some of my friends on the way SharedMemoryCache works, and one repled with the following:

The way shared memory works is that all CODE segments are loaded into SHM, not DATA which usually goes on the stack. By sharing CODE segments, your programs can reuse parts of the memory store where there's no change in the code. If you wanted to store DATA in SHM, you'd need to do something custom to UNIX and need gigs of RAM.

Either that or write something to alloc all the memory ahead of time....

It sort of bummed me out a bit, however I'm now taking the opportunity to write a persistant cache module.

Yup, I know there is already a Cache::SharedFileCache, however I figure I might use this opportunity to hone my OOP skills (which arent very good).

My module wont be very complicated, and will use a RDBMS for the store, and only have a couple of methods, namely memorise, new, and remember.

Comments welcome..


In reply to Re: SharedMemoryCache: How does it really work? by Ryszard
in thread SharedMemoryCache: How does it really work? by Ryszard

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.