From: "Markus Mottl" <markus.mottl@gmail.com>
To: "Joel Reymont" <joelr1@gmail.com>
Cc: "O'Caml Mailing List" <caml-list@yquem.inria.fr>
Subject: Re: [Caml-list] ocamlnet and kernel poll
Date: Thu, 11 Sep 2008 10:04:38 -0400 [thread overview]
Message-ID: <f8560b80809110704u62c4a661y9dc467167d9b9833@mail.gmail.com> (raw)
In-Reply-To: <01677251-3A8D-4DCA-9E39-7D17FAC92645@gmail.com>
On Thu, Sep 11, 2008 at 8:43 AM, Joel Reymont <joelr1@gmail.com> wrote:
> Suppose I want to build a server that runs on top of ocamlnet and handles
> 10k+ connections.
>
> ocamlnet seems to use select exclusively.
>
> Any suggestions on how to add kernel poll? Is this possible even?
The Core-library that we developed at Jane Street, and which is also
in Godi, contains a module "Linux_ext", which has a fully-featured
interface to epoll (besides lots of other Linux-specific goodies).
There you just call "Epoll.create" to get a file descriptor on which
to listen for I/O-events. Then you only need to add other file
descriptors you want to monitor with "Epoll.add", specifying flags for
the kind of events you want to wait for. "Epoll.modify" and
"Epoll.del" modify event flags of and remove monitored descriptors
respectively. "Epoll.wait" allows you to wait for received events
(similar to "select").
Note, however, that "select" is usually more efficient for small (=
tens) numbers of descriptors!
Regards,
Markus
--
Markus Mottl http://www.ocaml.info markus.mottl@gmail.com
next prev parent reply other threads:[~2008-09-11 14:04 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-11 12:43 Joel Reymont
2008-09-11 12:51 ` Sylvain Le Gall
2008-09-11 13:42 ` [Caml-list] " Gerd Stolpmann
2008-09-11 14:04 ` Markus Mottl [this message]
2008-09-11 14:37 ` Mattias Engdegård
2008-09-11 15:32 ` Markus Mottl
2008-09-11 15:43 ` Joel Reymont
2008-09-11 15:50 ` Sylvain Le Gall
2008-09-11 16:31 ` [Caml-list] " Markus Mottl
2008-09-24 15:05 ` Rich Neswold
2008-09-24 15:43 ` Gabriel Kerneis
2008-09-26 15:53 ` Rich Neswold
2008-09-24 17:28 ` Markus Mottl
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=f8560b80809110704u62c4a661y9dc467167d9b9833@mail.gmail.com \
--to=markus.mottl@gmail.com \
--cc=caml-list@yquem.inria.fr \
--cc=joelr1@gmail.com \
/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