The mechanism for sharing, threads::shared, doesn't look very practical for sharing a complex 1GB AI model. It looks like the code constructing the model would have to be modified a fair amount to construct things in the right order and mark every variable shared. Maybe you know a higher-level way to do this though.
For read-write data, I do think threads would use less memory if the vast majority of the program is the shared AI model. For read-only data, COW will do pretty well at sharing with no changes to the code and will share things that are outside of the AI model as well if they don't get modified.
COW with threads would help with all the variables that you don't have an easy way to mark shared but don't need separate copies of, e.g. all of the data used by all of the CPAN modules you load.
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.