From: davidsen@ariel.crd.GE.COM (william E Davidsen) Subject: Re: BBS Development for Linux Date: Thu, 17 Jun 1993 13:36:34 GMT
In article <1993Jun16.165802.14291@swan.pyr>, iiitac@swan.pyr (Alan Cox) writes:
| In article <C8o6KD.Knw@crdnns.crd.ge.com> davidsen@crd.ge.com (bill davidsen) writes:
| > I found that the best results came from putting small messages in the
| >message file, and for large messages I put the filename in and set a
| >flag.
| >
| No don't put filenames in. Put all the text for every message into a single
| file and store offset values into it. An lseek() is far faster than an open(),
| and you'll get better disk throughput as the OS tries to keep a file linear
| and together. Not only that but forward motion is optimized by a normal unix
| (and non unix kernel), so that you can skip the seeks when moving forwards
| message by message - typical user behaviour - and get the benefit of the
| kernel read ahead.
No thanks, I do delete messages, and that works a lot better when the
message is in a file rahter than trying to reclaim parts of a file, or
letting the file get huge, or any of the other solutions. Same reason
news keeps articles in separate files, and the filename allows me to
access existing files rather than keeping a copy in the BBS data
structure. Also allows easy update of messages with time dependent info,
etc.
Pointers work well for many things, but you run into a lot of garbage
collection hassles trying to get the space back.
--
bill davidsen, GE Corp. R&D Center; 518-387-6489
TMR Associates, +1 518-370-5654
Custom programming, system configuration, data acquisition,
industrial monitoring and "smart house" environment control.