caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Gerd Stolpmann <info@gerd-stolpmann.de>
To: Bardur Arantsson <spam@scientician.net>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Re: async networking
Date: Tue, 07 Feb 2006 20:01:08 +0100	[thread overview]
Message-ID: <1139338868.12287.185.camel@localhost.localdomain> (raw)
In-Reply-To: <dsamam$4d3$1@sea.gmane.org>

Am Dienstag, den 07.02.2006, 18:44 +0100 schrieb Bardur Arantsson:
> skaller wrote:
> > On Mon, 2006-02-06 at 19:34 +0100, Bardur Arantsson wrote:
> > 
> >> However, if you want very high-performance networking
> >> you'd be better off with something closer to the metal, i.e. something
> >> like a libevent wrapper 
> > 
> > Argg no. Libevent isn't a library, it doesn't control invert.
> > It is a monolithic framework. Therefore it is not very useful because
> > your code will no longer be composable. In particular,
> > there is no way to compose two such frameworks, for example
> > you cannot use it with an event driven GUI framework.
> > 
> 
> Note that I said 'high-performance'.
> 
> Point #1: select() and anything based on it (I believe Equeue still is 
> though I haven't looked at it for quite a while) is woefully inadequate 
> for high performance I/O except in very specific circumstances.

Yes, the default Equeue implementation bases simply on select(). It is,
however, possible to develop alternate implementations. Currently, there
are three of them which integrate into the event loops of labltk,
lablgtk1 and lablgtk2. One could, for example, easily add an
implementation for advanced kernel interfaces like epoll. Or one that
sits upon libevent. There is, however, the basic design decision that
all events pass the same queue. This mainly has a certain scheduling
effect (application-driven scheduling), and increases latency if the
queue gets too long, but shows good behaviour under high load.

select() is, as far as I know, only bad if the file descriptors are
linked with many different processes, because all that processes must be
waked up in order to check the descriptors (even if no I/O can happen).
But if you only have Internet sockets, I expect that select() performs
well.

> Point #2: It is not customary for UI applications to require 
> particularly high-performance I/O, thus rendering the non-composability 
> issue moot.

There are many aspects of high performance, for example throughput,
latency, and whether a low or high number of descriptors are watched. UI
applications are often interested in low latency for a moderate number
of descriptors.

I think there is another point why it is a bad idea to distinguish
between, say UI and server applications. Network components should be
shareable between all types of applications. For example, an HTTP
component is useful for both, so why should we develop an extra one for
specific needs of high performance?

Gerd

> I'm _not_ recommending libevent for general use, just if you want high 
> performance with an easily switchable backend implementation.
> 
> Cheers,
> 
-- 
------------------------------------------------------------
Gerd Stolpmann * Viktoriastr. 45 * 64293 Darmstadt * Germany 
gerd@gerd-stolpmann.de          http://www.gerd-stolpmann.de
Telefon: 06151/153855                  Telefax: 06151/997714
------------------------------------------------------------


  parent reply	other threads:[~2006-02-07 19:01 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-05  8:52 Rick Richardson
2006-02-05 17:32 ` [Caml-list] " Gerd Stolpmann
2006-02-06 18:34   ` Bardur Arantsson
2006-02-07  4:55     ` [Caml-list] " skaller
2006-02-07 17:44       ` Bardur Arantsson
2006-02-07 18:44         ` [Caml-list] " Rick Richardson
2006-02-07 19:01         ` Gerd Stolpmann [this message]
2006-02-07 19:43           ` Bardur Arantsson
2006-02-07 20:30             ` [Caml-list] " Gerd Stolpmann
2006-02-07 20:51             ` Remi Vanicat
2006-02-07 21:29         ` Rick Richardson
2006-02-07 22:03           ` Jonathan Roewen
2006-02-08  4:18             ` Rick Richardson
2006-02-08 14:43               ` Markus Mottl
2006-02-08  4:29           ` skaller
2006-02-05 20:18 ` [Caml-list] " Pierre Etchemaïté

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1139338868.12287.185.camel@localhost.localdomain \
    --to=info@gerd-stolpmann.de \
    --cc=caml-list@inria.fr \
    --cc=spam@scientician.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).