home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!enterpoop.mit.edu!eru.mt.luth.se!hagbard!loglule!jbn
- From: jbn@lulea.trab.se (Johan Bengtsson)
- Newsgroups: comp.std.c++
- Subject: Re: Zero-length structures and pointer comparisons
- Message-ID: <5458@holden.lulea.trab.se>
- Date: 21 Dec 92 19:30:51 GMT
- References: <9235622.25587@mulga.cs.mu.OZ.AU>
- Organization: Telia Research AB, Aurorum 6, 951 75 Lulea, Sweden
- Lines: 56
- Cc: jbn
- X-Newsreader: TIN [version 1.1 + PL8]
-
- Fergus James HENDERSON (fjh@munta.cs.mu.OZ.AU) wrote:
- : jbn@lulea.trab.se (Johan Bengtsson) writes:
-
- : >Markku Sakkinen (sakkinen@jyu.fi) wrote:
- : >: BTW, actually total order is
- : >: a simple thing within an OODB _because_ the identity of each object
- : >: is assured not to change.
- : >
- : >It would impose severe restrictions on how the virtual address space
- : >could be used though. The OODBMS may end up in a situation where
- : >it can't get a persistent object into memory, not because it has used up
- : >all virtual memory addresses, but because all unused virtual memory
- : >adresses would violate the total ordering property.
-
- : I thought that the idea was that for OODBMSs, you DON'T compare virtual
- : addresses for pointers to persistent objects, instead you compare the object
- : ids. Maybe someone could explain the problems in a little more detail?
-
- As Stuart MacMartin said, if the OODBMs uses objects of class Handle
- (never mind the name) to represent references to persistent objects
- you will need to have
-
- ptrcmp(Handle,Handle), if you want templates to compare Handles the
- same way they compare pointers. The OODBMs should provide that.
- Also it should provide ptrcmp(Handle,void*) and ptrcmp(void*,Handle).
-
- _Some_ OODBMs use void* as their Handles (they play tricks by
- using virtual memory mapping to persistent storage), so they must
- provide a ptrcmp(void*,void*) that can tell the difference between
- pointers to persistent objects and normal memory pointers. For persistent
- objects, it then finds the object ids and makes the comparison.
-
- My point is that this may be difficult, or slow (although I don't
- really have any data on that). The alternative is to simply compare
- the void pointers, even for pointers to persistent objects, however
- that imposes the unacceptable restrictions I described in my previous
- posting.
-
- A more difficult issue is what do you do if there is more than one
- OODBMs in use, or more realistically, one OODBM, and one distributed
- object manager (that similarly uses Handles to distributable objects).
- Who is responsible for providing the needed ptrcmp(OODB_Handle,Distr_Handle)
- and ptrcmp(Distr_Handle,OODB_Handle) functions? This may become
- totally unmanageable if handle-based schemes become common.
-
- Hope this is a little bit clearer.
-
- --------------------------------------------------------------------------
- | Johan Bengtsson, Telia Research AB, Aurorum 6, S-951 75 Lulea, Sweden |
- | Johan.Bengtsson@lulea.trab.se; Voice:(+46)92075471; Fax:(+46)92075490 |
- --------------------------------------------------------------------------
- --
- --------------------------------------------------------------------------
- | Johan Bengtsson, Telia Research AB, Aurorum 6, S-951 75 Lulea, Sweden |
- | Johan.Bengtsson@lulea.trab.se; Voice:(+46)92075471; Fax:(+46)92075490 |
- --------------------------------------------------------------------------
-