shy stackless Re: ANNOUNCE: xsdb -- the eXtremely Simple Database goes alpha

Aaron Watters aaron at
Wed Dec 10 20:26:11 CET 2003

Istvan Albert <ZZZ-ialbert-ZZZ at> wrote in message news:<Y-ydnYsliZvoqkqiRVn-sA at>...
> Aaron Watters wrote:
> > General Technical Notes:
> > The xsdb package is implemented in Python, and the server mode requires 
> > stackless python.
> Why?
> IMHO this sort of limitations severely reduce any
> project's potential.
> Istvan.

Because it's the Right Way (tm) to do it :).

First let me emphasize that only the server layer
uses stackless at present.

I'm using stackless because (aside from the fact that 
it was simplest way implement the functionality)
database concurrency control requires the following:

If a young transaction tries to read something written by
an old transaction which has not yet committed it must wait
until the old transaction decides to commit or abort.

In order to allow transactions to wait the options are:

1) Use an event loop and write the application "inside out",
   much like a fortran 4 program attempting to emulate recursion.

2) Use operating system threads (which have very high overhead
   and sometimes don't really work the same across different

3) Use stackless.

4) punt: automatically abort any transaction which needs
   to wait.

As a first approach I went for (3) because it was easy.  I don't
plan to do (1) because I treasure my sanity.  I intend to
implement both (2) and (4) as server options before I call 
xsdb a "beta", but I want to also keep the stackless version alive.

I'm still wishing that real stackless functionality will make it
into standard Python, but I also don't really understand the
deep implications.
   -- Aaron Watters

I don't know if you've been loving somebody
I only know it isn't mine.   -- Elvis Costello "Alison"

More information about the Python-list mailing list