On 21 Feb 2003 19:02:26 +0200, Timo Sirainen wrote:
> OK, I looked through c-client and Pine code. It looks just as difficult
> as I expected. It uses multiple arrays for seq <-> message lookups.

Bullshit.  There is one cache.  Don't get confused by the sortcache which is
not seq->message lookup.

> It
> often has to go through the whole array just to find the message (for
> every message it has to fetch I think?).

That's only if you look up by UIDs, which a well-written client rarely has to
do if you use sequence numbers effectively.

I imagine that if I created a UID->seq hash table you would then be saying "it
has to maintain multiple tables to support sequence numbers."

> And of course it has to update
> the arrays every time messages are expunged.

The only reason why it does that update is for a feature that is so advanced
that most clients don't use it; a multithread client (such as my MailManager
application) can "lock" a message cache entry and prevent it from being
expunged even if it is expunged on the server.  That way it doesn't have to
maintain a separate copy, ever; but it does need a back pointer.

I doubt very much that there's anything like that in your UID-only client.

> Pine also doesn't seem to do any automatic reconnection to server. I'd
> think that would get annoying with bad internet connections.

It's rare to need to do automatic reconnection, even with flakey network
connections, if you do networking the way you're supposed to.  Such as not
killing a perfectly good TCP connection because of the slightest router flap.

Most of the need for automatic reconnection vanishes if you take the trouble
not to sacrifice connections.

CDPD is about as flakey as you can get, yet Pine works quite well with it.

> If it did
> do reconnecting, would the current code require resyncing everything
> after connect

Since we never fetch everything, we never need to resync everything.  Just
toss out the local cache and do demand-fetching.

Demand-fetching is good.  Demand fetching means that you work on slow
connections.

Pine works well over CDPD.  Does your client?

Reply via email to