The document discusses pointer swizzling techniques, which involve converting object identifiers to memory pointers to optimize access to objects that have been retrieved from secondary storage into main memory. It covers different approaches for object referencing like edge marking and node marking, as well as issues like copy versus in-place swizzling, eager versus lazy swizzling, and direct versus indirect swizzling.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
88 views13 pages
Point Swizzerling-An Approach by Example
The document discusses pointer swizzling techniques, which involve converting object identifiers to memory pointers to optimize access to objects that have been retrieved from secondary storage into main memory. It covers different approaches for object referencing like edge marking and node marking, as well as issues like copy versus in-place swizzling, eager versus lazy swizzling, and direct versus indirect swizzling.
The action of converting object identifiers (OIDs)
to main memory pointers. • Aim is to optimize access to objects. • Should be able to locate any referenced objects on secondary storage using their OIDs. • Once objects have been read into cache, want to record that objects are now in memory to prevent them from being retrieved again.
memory pointers (e.g. using hashing). • Pointer swizzling attempts to provide a more efficient strategy by storing memory pointers in the place of referenced OIDs, and vice versa when the object is written back to disk.
• Easiest implementation is not to do any swizzling.
• Objects faulted into memory, and handle passed to application containing object’s OID. • OID is used every time the object is accessed. • System must maintain some type of lookup table - Resident Object Table (ROT) - so that object’s virtual memory pointer can be located and then used to access object. • Inefficient if same objects are accessed repeatedly. • Acceptable if objects only accessed once.
resident objects. • Most techniques variations of edge marking or node marking. • Edge marking marks every object pointer with a tag bit: • if bit set, reference is to memory pointer; • else, still pointing to OID and needs to be swizzled when object it refers to is faulted into.
• Node marking requires that all object references
are immediately converted to virtual memory pointers when object is faulted into memory. • First approach is software-based technique but second can be implemented using software or hardware-based techniques.
to detect accesses of non-resident objects. • Use standard virtual memory hardware to trigger transfer of persistent data from disk to memory. • Once page has been faulted in, objects are accessed via normal virtual memory pointers and no further object residency checking is required. • Avoids overhead of residency checks incurred by software approaches.
copied into application’s local object cache or accessed in-place within object manager’s database cache . • Copy swizzling may be more efficient as, in the worst case, only modified objects have to be swizzled back to their OIDs. • In-place may have to unswizzle entire page of objects if one object on page is modified.
• Moss defines eager swizzling as swizzling all OIDs
for persistent objects on all data pages used by application, before any object can be accessed. • More relaxed definition restricts swizzling to all persistent OIDs within object the application wishes to access. • Lazy swizzling only swizzles pointers as they are accessed or discovered.
• Only an issue when swizzled pointer can refer to
object that is no longer in virtual memory. • With direct swizzling, virtual memory pointer of referenced object is placed directly in swizzled pointer. • With indirect swizzling, virtual memory pointer is placed in an intermediate object, which acts as a placeholder for the actual object. • Allows objects to be uncached without requiring swizzled pointers to be unswizzled.