gcl-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gcl-devel] Re: Server sockets with GCL?


From: Chris Hall
Subject: [Gcl-devel] Re: Server sockets with GCL?
Date: Fri, 07 May 2004 01:45:20 -1000
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.2 (gnu/linux)

Jeff Dalton <address@hidden> writes:

> Quoting Helmut Eller <address@hidden>:
>
>> CMUCL's SERVE-EVENT[*] mechanism is a relatively convenient way to do
>> multiplexing.  It's an interface to select.  The basic idea is that
>> you add handler functions to file descriptors and the handler gets
>> called when the descriptor becomes readable or writable.
>
> That sounds good.  I definitely want something very like select,
> and not only for working with sockets.
>
>> I'd like to note that multiplexing is not only interesting for
>> sockets, but for all kinds of file descriptors, e.g., pipes to
>> subprocesses.  I think it would be a mistake to build the multiplexing
>> functionality directly into the socket interface (Lispworks does that
>> unfortunately); it would be better to keep provide a separate
>> mechanism like CMUCL does.
>
> I agree.
>
> -- Jeff

I'll also vote for select(), in whatever form, though the more generally
useful, the better, I'd say.  Especially if the level of effort is
appreciably lower than other approaches.

Twisted, http://www.twistedmatrix.com/, is a Python networking framework
that is based on select(), but only for sockets, AFAIK.  I've used it a
fair amount, and once I got my mind around async-style programming,
loved it.  For relatively long-running and blocking tasks, they maintain
a pool of threads - on top of this is a class for database queries.

Performance of web apps is marvelous when coded appropriately, in my
experience.

Twisted offers different flavors of select() 'engines' - one for
networking, one for GUIs (GTK, IIRC) and one for Windows, I think
because Windows select() processing is significantly different than
*nix/Posix?  Twisted also offers the abstraction of a 'Deferred' object,
which accepts a callback parameter and an optional 'errback' error
handler parameter.  'Deferred' callbacks/errback are automagically
integrated into the select() engine.

I am not at all suggesting all of this, merely pointing out what has
already been achieved elsewhere via the select() approach.

If GCL had a select() 'engine', I would happily turn to creating some of
the above for myself and whoever might else be interested.

Aloha,
+Chris

P.S.  Interestingly, for me at least, Twisted also allows for the
equivalent of connecting to the REPL of a running instance of Twisted -
I've used it mostly to reload modified object definitions, but one can
also inspect and/or modify pretty much everything in the instance, as
well.

-- 
You may have a fresh start any moment you choose, for this thing
that we call 'failure' is not the falling down, but the staying down.
-- Mary Pickford (1893 - 1979)

Attachment: pgp2zFpmIMQAb.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]