Re: Sharing Data Between App Instances
- From: Patricia Shanahan <pats@xxxxxxx>
- Date: Wed, 27 Dec 2006 22:42:21 GMT
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
.
- Follow-Ups:
- Re: Sharing Data Between App Instances
- From: Lew
- Re: Sharing Data Between App Instances
- References:
- Sharing Data Between App Instances
- From: Mike
- Sharing Data Between App Instances
- Prev by Date: Re: Catching NPEs
- Next by Date: Re: Calling applet from a java script
- Previous by thread: Re: Sharing Data Between App Instances
- Next by thread: Re: Sharing Data Between App Instances
- Index(es):
Relevant Pages
|
|