Subject Re: [IB-Architect] trouble with sweep
Author Ann W. Harrison
At 04:19 PM 10/18/2002 +0200, Pavel Cisar wrote:

>I would like initiate a discussion about current implementation of sweep

The problem is with the garbage collect thread. Sweep is something
slightly different. As you said, garbage collection was cooperative -
all processes doing it as necessary. For V6, in SuperServer only,
Charlie implemented a separate garbage collect thread which runs in
background. When a process finds a record that needs garbage collection
it put the record id (I think) on a list and notifies the garbage
collection thread. The garbage collection thread does the actual

The purpose was to avoid the spiky performance of cooperative garbage
collection - having one transaction's performance affected by the
actions of an earlier transaction.

There's some slightly tricky code that causes the garbage collection
thread to go away after the last connection exits so the server can be
closed down. There may be a bug in that, causing the garbage collector
to quit and not restart. Or, as you suggest, it may be that the
garbage collector thread just doesn't get enough cycles in an active

A difference between a sweep thread and the garbage collect thread is
that the sweep thread goes through the database sequentially while
the garbage collect thread follows an action list.


We have answers.