[DGD] Why export data structures?

Kris Van Hees aedil at alchar.org
Thu Jun 23 00:51:01 CEST 2005


Older versions of DGD actually handled arrays and mappings as references to a
single instance of the structure, until the object got swapped out (which did
cause the object to getits own copy of the structure data).  Because swapping
of objects was unpredictable, that behaviour got changed to be more specific.
I remember long conversations with Dworkin about that logic, because I was in
fact implementing just that as part of my Master's Thesis.  The logic in  DGD
reflects the same concept, with Dworkin's own implementation (and as far as I
can see that implementation has of course also evolved over time  with  other
features being added to DGD).

	Cheers,
	Kris


On Wed, Jun 22, 2005 at 03:44:37PM -0700, Noah Gibbs wrote:
>   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
> __________________________________________
> http://mail.dworkin.nl/mailman/listinfo/dgd

-- 
Never underestimate a Mage with:
 - the Intelligence to cast Magic Missile,
 - the Constitution to survive the first hit, and
 - the Dexterity to run fast enough to avoid being hit a second time.



More information about the DGD mailing list