[DGD] Why export data structures?
Noah Gibbs
noah_gibbs at yahoo.com
Thu Jun 23 00:45:01 CEST 2005
There are probably many fine reasons. One reason is that the way DGD handles
memory strongly suggests it. DGD handles its memory in very explicit chunks -
specifically, each DGD 'object' is managed as a single chunk. Objects can
point at each other, but pointing at sub-objects (like mappings, LWOs or
arrays) inside other DGD objects would require the memory management to be
messier.
Currently DGD can have a single identifier for each DGD object, so you can
potentially have four billion of them. Being able to point to sub-objects
would give you less 'name space' in that sense. I guess you could point to
sub-objects as offsets from the start of their actual object - but then, that's
pretty much the equivalent of how you handle them now in LPC.
Also, currently it's easy to tell when you might be pulling a bunch of new
stuff into memory. If you could reference other people's sub-objects without
using DGD object pointers, you'd have a bunch of other cases where you could be
pulling their stuff into memory.
None of this actually demands that you not be able to touch other people's
sub-objects, they're just reasons why it's basically a good idea not to. I
don't know of any reason why DGD couldn't be altered to do this, though I
expect it'd be a lot of work.
--- Petter Nyström <md1pette at mdstud.chalmers.se> wrote:
> Hello!
>
> This is really just a question out of curiousity. I was thinking of coding
> something that relied on several objects having access to the same data
> structure - in this case a mapping. But then I learned that such data
> structures are made into individual copies in all objects referencing it
> at the end of the execution thread. So as I understand it, the objects
> would no longer be referencing the same data in later threads.
>
> Now, I have no reason to be upset why it works like this. I am merely
> being curious as to the reasons. Why does DGD do this? If someone's got
> the time to satiate my curiousity, I'd be happy!
>
> Regards,
>
> Jimorie
> __________________________________________
> http://mail.dworkin.nl/mailman/listinfo/dgd
>
____________________________________________________
Yahoo! Sports
Rekindle the Rivalries. Sign up for Fantasy Football
http://football.fantasysports.yahoo.com
More information about the DGD
mailing list