On Tue, 27 Mar 2001, DeWitt Clinton wrote:
> Now, this implies that a module, such as the Cache::MemoryCache, which
> currently shares data for a particular process by creating a global
> hash, would only share data for one instance of the Perl interpreter
> associated with that thread.  If I wanted to extend the cache to share
> data between multiple threads, I would create what Doug calls a
> "solar" variable to hold that hash, correct?

I don't think so.  A solar variable is used for sharing data between
threads with the same parent interpreter, and only for that, but your
Cache::* modules will work with any combination of threads and processes
since the data is really stored outside of the interpreter in shared
memory or files.  Even if you use globals, they are only global to the
current thread.

- Perrin


Reply via email to