in reply to Sharing large data structures between threads
Okay then, if the number of threads is excluded as a matter of discussion, what about the roles of these various threads? Are they all simply clones of one another? Would it be possible, for example, to delegate one thread that actually owns the data-structure, and that provides information about it to the other processes on-request?
I really get nervous about “highly pervasive” code changes, like rewriting the code to use one-dimensional hashes and so forth. Even though they might “solve” the problem, they tend to introduce a lot of instability into the code. Per contra, the “arkane magick” of accessing the data-structure could perhaps be spun off into a single object, which encapsulates all of the necessary incantations for actually getting to the thing (or perhaps to a relevant slice of it). That would allow you to utter some pretty darned outrageous “spells,” and since you are only uttering them in one place, to still keep the code maintainable.
The notion of using tie is a good one, because the tie mechanism is pretty darned magickal already. I would definitely explore that idea further.
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Sharing large data structures between threads
by Anonymous Monk on Mar 09, 2011 at 23:39 UTC | |
by locked_user sundialsvc4 (Abbot) on Mar 10, 2011 at 13:19 UTC |