28 Implementation overview

This describes the implementation of the cxPersistStore library.

Links

Todo

  • The ROT can also call PersistStore::LoadObject() to implement a synchronous load
  • Analyse lifetime management at CSpace level.
  • Document and implement DestroyPSpace()
  • Do we have a concept of disabling the store? Do we need to commit locks?
  • Allow for other open modes
  • Allow for transferal of objects between PSpaces.
  • Unit test PSpaceTxnGroupMgr
  • Public headers should be very well commented
  • Search for "todo"
  • Can't use global variable EPrefVisitMode
  • Is tls_prefSerialiser needed?
  • [Maybe] Put all PersistStore configuration settings into a single struct.
  • Can we unit test the ROT or BindObjectGivenOid()?
  • Measure performance
  • Unit tests ensure invalid use causes assertion failures
  • Should assertion failure occur when there is a nested transaction on a PersistStore?
  • Allow for object cloning?
  • Allow for anonymous PSpaces

TODO

  1. Rather than have cref and pref, can we just have pref and use template specialisation to get both versions? Haven't we already done that with GcRoot?
  2. Find a way to allow validation of MarkAsDirty() to be enabled at run time with minimal performance penalty when it is turned off, rather than using a macro. This is so that application programmers built on top of CEDA can enable it as well.
  3. Avoid the huge macros to implement DoubleLinkedList, PDeque and B+Trees. Rfactor the code to use normal C++ templates as much as possible.
  4. Implement proposal to remove the PSpaceRoot
  5. Support anonymous PSpaces

DONE

  • New much simpler implementation of the ROT. When there is a synchronous request for an object that is being loaded asynchonously treat as an unsual corner case and don't try to reuse effort
  • New AsyncObjectLoader uses two vectors of OIDs allowing for vary efficient of pusing oids to be async loaded, and io_context swaps the two vectors when it's ready to process more.
  • PersistStore implements LoadObject() which returns both an EAsyncBindResult and a unique_interface_ptr
  • Now that PSpace implements IOperationCallBacks the handlers can be simplified and made more efficient.
  • PSpaceTxn seems wrong - it is locking the CSpace which already does the transaction, then creating another transaction [redundant: PSpaceTxn doesn't even exist anymore].
  • Remove PSpaceLockMode, PersistStoreTxn, PSpaceTxn, PSpaceTxn2, PSpaceTransferTxn
  • PSpace implements IOperationCallBacks
  • Implement proposal to achieve better validation of MarkAsDirty() without need to call WriteAllDirtyObjectsToLss() when a transaction closes
  • CidMap looks up the ReflectClasses when it is first loaded from disk, not lazily
  • PSpaceDos is using a volatile bool
  • PSpaceDos is using a mutex to protect the deque under the assumption that a CSpace has an RW lock. The mutex doesn't seem necessary, the deque is only accessed by a thread that has locked the CSpace.

Word documents

Pdf documents

cxPersistStore Source code

Source directory: Ceda/cxPersistStore