On Thu, 1 May 2008, Tzvetan Mikov wrote:
> On May 1, 5:38 am, "Kjetil S. Matheussen" <k.s.matheus...@[EMAIL PROTECTED]
>
> wrote:
> > (It's been suggested that I post this announcement on comp.lang.scheme
> > and comp.lang.functional as well as computer music specific fora,
> > so here it goes. Note that the garbage collector exploits the
> > specific nature of audio block processing to perform snapshots, so
the
> > (very simple) technique its using does not work in general to
guarantee
> > hard realtime.)
> >
> > The Audio Rollendurchmesserzeitsammler V0.0.1.
> >
> >
http://www.notam02.no/arkiv/src/rollendurchmesserzeitsammler-0.0.1.ta...
> > [...]
>
> Can you please explain in some more detail what makes it real-time ? I
> scanned the README, but it says that it is a traditional mark & sweep,
> without any barriers or tricks. Does it copy the entire heap and then
> sweep it in parallel with the application thread ?
>
Exactly, thats what "snapshot" means (although only mark happens in
parallel, not sweep, but sweep can be interrupted and continued later
at next audio block exit).
There are two reasons why this can work very well:
1. Realtime audio processing code is often
compact and doesn't require extremely large heaps (1 megabyte might
be enough, but larger heaps can work fine as well).
2. Its common to run many "instruments" simultaniously,
which has the advantage of making it possible to let one
instrument run signal processing code while all the other
instrumentst can do their snapshots. And when having a snapshot,
marking and sweeping runs in complete parallel with respect to both
owning and not-owning instruments.
As I said, this is not a general technique for doing hard realtime
garbage collecting, it will only work for the kind of tasks which are
synchronized by a clock, sometimes has some time to spare doing
snapshots, and preferably where there are many processes running
simultaniously (although not necessarily concurrently) not sharing
heaps. Audio is one such type of task, video might be another.


|