Commit d9bcbc88 authored by Per Cederqvist's avatar Per Cederqvist
Browse files

Added a comment that describes a better way to implement garbage colletion

of texts.
parent 58bba71a
Wed Oct 7 00:43:03 1992 Per Cederqvist (ceder@mauritz)
* text-garb.c: Added a comment that describes a design for a
better way to implement garbage collection of texts.
Sun Sep 6 20:30:01 1992 Per Cederqvist (ceder@robert)
* version.incl: Version 1.2.5.
......
/*
* $Id: text-garb.c,v 0.6 1992/02/26 18:44:57 ceder Exp $
* $Id: text-garb.c,v 0.7 1992/10/06 23:45:00 ceder Exp $
* Copyright (C) 1991 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -28,7 +28,7 @@
* Author: Per Cederqvist.
*/
static char *rcsid = "$Id: text-garb.c,v 0.6 1992/02/26 18:44:57 ceder Exp $";
static char *rcsid = "$Id: text-garb.c,v 0.7 1992/10/06 23:45:00 ceder Exp $";
#include <time.h>
......@@ -40,6 +40,38 @@ static char *rcsid = "$Id: text-garb.c,v 0.6 1992/02/26 18:44:57 ceder Exp $";
#include "text-garb.h"
#include <debug.h>
/*
* This comment is a description of how this _could_ be done in a more
* efficient way. It is not yet implemented. Design by Inge Wallin
* and Per Cederqvist 1992-10-07.
*
* Today, all text statuses are read into the core during the garbage
* collection phase. Due to step 3 below we think that we can reduce
* the number of text-status-fetches by 95 %.
*
* 1) Allocate a bitmap with one bit for each text. Clear all bits.
* This bit is set as soon as it is certain that this text should
* not be deleted during this garbage collection pass.
* 2) Loop over all persons:
* + Set the bit for all his/her marked texts.
* (This step may, or may not, be efficient. Profile your code!)
* 3) Loop over all conferences:
* + Loop over all texts in the conference:
* + If the bit is already set, skip the text.
* + Retrieve the text status from the data base.
* + If it is old enough (in all the recipient conferences)
* delete it.
* else
* set the bit.
* + If it is too young to be deleted (only
* considering this conferene)
* + Set the bit for this text and all subsequent
* texts in this conference.
* 4) Loop over all remaining texts:
* + If the bit is not set,
* + delete the text. (It has no recipients).
* 5) Deallocate the bitmap and wait 24 hours.
*/
/*
* Delete old texts.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment