Boost logo

Boost :

Subject: Re: [boost] persistence library proposal (with prototypeimplementation)
From: Ilya Bobir (ilya.bobir_at_[hidden])
Date: 2009-08-09 21:41:13


Robert Ramey wrote:
> I'm wondering if a better name might be something like
>
> transaction process library
>
> or?
>
> rather than persistence library.

IIUC, MVCC can be used to structure complex multithreaded applications,
like Postgres or Oracle
(http://en.wikipedia.org/wiki/Multiversion_concurrency_control#Databases_with_MVCC).
It also seems to me that Clojure uses similar approach as a general way
to do multithreading (http://clojure.org/concurrent_programming) also
there it is called Software Transactional Memory (http://clojure.org/refs).

While other aspects of the library, like automatic loading and unloading
of objects, maybe of interest to potential users, the multithreaded
aspect seems to be very interesting and may be of great demand as the
number of CPU cores per machine is increasing.

By the way the Wikipedia article on STM
(http://en.wikipedia.org/wiki/Software_transactional_memory) has a
reference to a library that already implements STM for C++ and is aiming
to become part of Boost:

http://eces.colorado.edu/~gottschl/tboostSTM/index.html

In any case it would be interesting to look at the library code or at
least at the documentation. I was thinking about writing something
similar several years ago but came to a conclusion that in order to make
a rather efficient implementation the library will need to track all
reads and writes on the shared object fields. As C++ does not have
reflection the user will have to describe shared objects in a very
special manner (like wraping all field types in some library provided
wrappers) in order for the library to be able to track all the
operations. But you seems to solve this issue somehow. How do you
track that a balance field is modified? And how do you know which
account objects were modified in a given transaction?

And it is interesting to know what level of isolation the library
provides or is supposed to provide. IIUC, if it aims at serializable
isolation level then you are actually providing an STM solution. But if
your isolation level is lower (or is changeable) then your library may
have different field of application than an STM providing one.

Ilya Bobir


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk