On Tue, 2004-08-17 at 05:46, Dossy Shiobara wrote: > > So far, this has been working really well for me. No modification to > the core involved, and it's implemented in very few LOC overall. Using > the same pattern, I could easily implement an SMTP, IMAP, etc., server > in pure Tcl. I'm not sure what the real performance difference there > would be compared to the two proposals that require C code changes in > the core: as long as the actual "functionality" is implemented in a Tcl > callback that gets invoked from the C code, the performance difference > is probably negligible.
The performance difference would certainly be noticeable. In your example code a new thread is spawned for each connection. This can take a non trivial amount of time, especially if a new interp has to be initialized. Each of your connection threads and all it's resources are committed for the life of the connection. It will remain committed until the client disconnects. There are some functional differences too: no access logging; none of the niceties of registered procs or filters; no caching of returned files, etc. etc. None of which matters for a toy like a Tivo server. An SMTP or IMAP server implemented like this wouldn't be worth the bother. -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]> with the body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: field of your email blank.
