Subject: Re: best approach for writing web server?
From: (Rob Warnock)
Date: 2000/09/21
Newsgroups: comp.lang.lisp
Message-ID: <8qck0b$105rtm$>
David Bakhash  <> wrote:
| There are non-forking servers, but they're complicated as hell.
| If they're non-forking, then they use select() and special non-blocking
| directives, and as far as I know, no Lisp-based socket system lets
| you go there.

Actually, MzScheme (the engine underneath DrScheme) provides select()-based
scheduling in its thread system. You write code within a Scheme thread
that *looks* likes it's blocking, but instead of blocking in the socket
I/O, the internal scheduler adds that fd to the FD_SET of the select()
call and runs some other thread.

Back on July 13th, Shriram Krishnamurthi <> posted
to comp.lang.scheme a tiny (couple of pages) web server written in
MzScheme that leaves the top-level listener running while servicing HTTP
requests -- useful for debugging. The server itself was single-threaded,
but moving the "thread" call until after the "tcp-accept" would make it
run a thread per request. See <>
for the code.

[O.k., it's Scheme, not Lisp, but the point is that you *can* seamlessly
integrate a socket facility with Scheme threads, and probably with (some)
Lisps, too.]


Rob Warnock, 41L-955
Network Engineering
Silicon Graphics, Inc.		Phone: 650-933-1673
1600 Amphitheatre Pkwy.		PP-ASEL-IA
Mountain View, CA  94043