From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id A5BE8BB84 for ; Thu, 11 Sep 2008 15:41:38 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AogAAMu8yEjU4363mWdsb2JhbACBZZB/AQEBAQEIBQYJEQOlHAGBYw X-IronPort-AV: E=Sophos;i="4.32,379,1217800800"; d="scan'208";a="17133557" Received: from moutng.kundenserver.de ([212.227.126.183]) by mail1-smtp-roc.national.inria.fr with ESMTP; 11 Sep 2008 15:41:38 +0200 Received: from gate.lan.gerd-stolpmann.de (dslb-084-059-115-200.pools.arcor-ip.net [84.59.115.200]) by mrelayeu.kundenserver.de (node=mrelayeu7) with ESMTP (Nemesis) id 0ML2xA-1KdmQT450v-0002kq; Thu, 11 Sep 2008 15:41:38 +0200 Received: from [192.168.0.32] (fw.lan.gerd-stolpmann.de [192.168.1.1]) by gate.lan.gerd-stolpmann.de (Postfix) with ESMTP id 8AF1FC077; Thu, 11 Sep 2008 15:41:37 +0200 (CEST) Subject: Re: [Caml-list] ocamlnet and kernel poll From: Gerd Stolpmann To: Joel Reymont Cc: O'Caml Mailing List In-Reply-To: <01677251-3A8D-4DCA-9E39-7D17FAC92645@gmail.com> References: <01677251-3A8D-4DCA-9E39-7D17FAC92645@gmail.com> Content-Type: text/plain Date: Thu, 11 Sep 2008 15:42:12 +0200 Message-Id: <1221140532.8762.15.camel@flake.lan.gerd-stolpmann.de> Mime-Version: 1.0 X-Mailer: Evolution 2.12.1 Content-Transfer-Encoding: 7bit X-Provags-ID: V01U2FsdGVkX1/wQe+gPSf/UlWGQeSTLRC/VP9U4fz/29PbTbe FKHAUX+XgBJg643CLHNLtZXHMwFtCrlKgzowHqubw+fPB4koml F+ZvURf35dnviV7OJQ5zohoXZT3mNEf X-Spam: no; 0.00; ocamlnet:01 gerd:01 stolpmann:01 donnerstag:01 ocamlnet:01 mli:01 mli:01 sockets:01 gerd:01 beginner's:01 ocaml:01 bug:01 stolpmann:01 viktoriastr:01 64293:01 Am Donnerstag, den 11.09.2008, 13:43 +0100 schrieb Joel Reymont: > Suppose I want to build a server that runs on top of ocamlnet and > handles 10k+ connections. > > ocamlnet seems to use select exclusively. There's also netplex in ocamlnet, which is a kind of fork framework. I don't know which protocol you want to use. For instance, you can arrange that netplex starts 100 processes and every process handles 100 connections. > Any suggestions on how to add kernel poll? Is this possible even? I'm in the middle of changing ocamlnet here, so we can have more flexibility for choosing the kind of event polling. Look at the svn version: https://godirepo.camlcity.org/svn/lib-ocamlnet2/trunk/code/ There's a lot of new stuff in the src/netsys directory. In the future, all polling will be based on the pollset class type (src/netsys/netsys_pollset.mli). There is currently an implementation that uses the poll() syscall (src/netsys/netsys_pollset_posix.mli) and another one for Win32 (src/netsys/netsys_pollset_win32.mli - limited to sockets and named pipes for now). As this is a class type you can also go ahead, and implement it for every kernel mechanism you like, and just you your class instead of the classes provided by ocamlnet. I'll add some more mechanisms later (any help is welcome). You can turn these pollsets into event_system by using src/equeue/unixqueue2.mli. This is not very much tested, however, and there is no support for multi-threading yet in this module. Many ocamlnet modules allow to inject whatever event_system you like to have (should be all modules in the future). All this is experimental for now. I have tested it only with small programs, not with large production systems. But maybe it's an option for you to use the svn version. Gerd > > Thanks, Joel > > -- > wagerlabs.com > > _______________________________________________ > Caml-list mailing list. Subscription management: > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > Archives: http://caml.inria.fr > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs > -- ------------------------------------------------------------ Gerd Stolpmann * Viktoriastr. 45 * 64293 Darmstadt * Germany gerd@gerd-stolpmann.de http://www.gerd-stolpmann.de Phone: +49-6151-153855 Fax: +49-6151-997714 ------------------------------------------------------------