Re: Sharing Data Between App Instances



Mike wrote:
Forgive me; this is sort of a newbie question. Is it possible to share in-
memory data between instances of an app?

I realize I could just write the info to disk with one instance then read it into the other instances from the disk, but I'd like to keep it in memory for performance reasons.

This data may need to be accessed simultaneously by separate instances in a read-only fashion. Only one instance will ever modify the data. It's possible that attempts to read and update the data simultaneously may occur so the code would need to support some type of locking.

Hopefully this question makes sense to someone besides me ;) Any code needs to work on JVM version 1.4 (in case that matters.)

Thanks in advance! This group has been infinitely useful in my learning. Hopefully soon I'll be able to contribute.

- Mike

Don't assume that every read of a shared file will cause a physical disk
read. Most operating systems do some disk caching, so frequently
accessed blocks may be in memory anyway.

Try whatever approach seems simplest first, and measure it. Make sure
you isolate the shared data access in your class design, so that the
implementation can be changed without rewriting the program.

Patricia
.



Relevant Pages

  • Proposed Assembler Commands
    ... ACM Automatically Clear Memory ... BKCRDR Backspace Card Reader ... BKSPD Backspace Disk ... EIAO Execute In Any Order ...
    (sci.electronics.design)
  • Re: Att. Alex Nichol -VM cont.
    ... I find documentation that says a 4kb page in memory is written to the hard ... manner that a 4kb memory page is equal to a 4kb cluster written on the disk". ... So where is the basis for saying since 4kb paging in memory that 4kb clusters ...
    (microsoft.public.windowsxp.general)
  • Re: teaching a child - console or GUI
    ... I use a RDBMS to reuse existing code and optimizations. ... >>And loading them in a system under load (with constant disk io) is worse ... quality stuff), and quality power supply, quality memory etc. ... > lists of pointers on disk, extract files of frequent search fields in ...
    (comp.lang.pascal.delphi.misc)
  • Re: First-timer buying AS/400 and have questions
    ... > (writes memory to disk for the next boot). ... > the 170 has a battery, which you will probably need to replace it ... Ahh, makes a little more sense now how Silverlake relates to Rochester, ...
    (comp.sys.ibm.as400.misc)
  • Re: teaching a child - console or GUI
    ... >> Are these objects very complex, or are they really a bunch of pointers ... >> One can hold a lot of those on disk ... ... Sure they do - however since memory is finite ... lists of pointers on disk, extract files of frequent search fields in ...
    (comp.lang.pascal.delphi.misc)