let us say that I am trying to write a program, in perl (obviously) that will receive requests from a TCP socket of some sort, and search through N number of tied hashes (which are tied to DBM's.) And let's say that this is running on a big beefy 2 proc alpha box, so it is in my best interest to run this as a 2 process application, so that I can fully utilize both processes and the oodles of spindles that I have in this machine. Now, here is the problem, comparitively, tying and untying hashes is an expensive proposition, and unfortunately I have MANY more hashes than I do available filehandles (and the situation is going to get worse.) What I would like to implement is some type of shared memory LRU cache that alowed both processes to share a list of commonly opened filehandles (tied hashes) so that we wouldn't have unnceccessary duplication of workload.

What is the big problem? Well, ALL of the shared memory modules available for perl (at CPAN) and all of the cache modules available for perl (also at CPAN) have too many limitations, the most common one being that the only thing that can be shared is information which can be serialized, which pretty much leaves out filehandles right off the bat. so, does anyone have any ideas how I would share an LRU cache of filehandles among multiple processes?


In reply to shared memory LRU cache which containes filehandles by Anonymous Monk

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.