From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 82440BBA7 for ; Tue, 7 Feb 2006 05:55:37 +0100 (CET) Received: from smtp1.adl2.internode.on.net (smtp1.adl2.internode.on.net [203.16.214.181]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id k174tZFR031324 for ; Tue, 7 Feb 2006 05:55:36 +0100 Received: from rosella (ppp21-250.lns2.syd7.internode.on.net [59.167.21.250]) by smtp1.adl2.internode.on.net (8.13.5/8.13.5) with ESMTP id k174tPth087740 for ; Tue, 7 Feb 2006 15:25:34 +1030 (CST) (envelope-from skaller@users.sourceforge.net) Subject: Re: [Caml-list] Re: async networking From: skaller To: caml-list@yquem.inria.fr In-Reply-To: References: <1139129530.15565.3.camel@localhost.localdomain> <1139160736.10812.3.camel@localhost.localdomain> Content-Type: text/plain Date: Tue, 07 Feb 2006 15:55:25 +1100 Message-Id: <1139288125.19213.36.camel@rosella> Mime-Version: 1.0 X-Mailer: Evolution 2.4.1 Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 43E82847.002 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 async:01 argg:01 manpage:01 spawned:01 wrote:01 sourceforge:01 invert:01 functions:01 library:03 dispatch:03 dispatch:03 gui:04 gui:04 frameworks:05 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 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. To quote the manpage: "In order to process events, an application needs to call event_dispatch(). This function only returns on error, and should replace the event core of the application program." Just try telling a GUI that *also* demands you use ITS event loop that! The only proper way to use libevent would be to spawn the dispatch loop inside a pthread, and use the hook functions to communicate with your program via channels. It isn't immediately clear this would work (libevent's single page of documentation doesn't explain if it works when spawned inside a pthread). -- John Skaller Felix, successor to C++: http://felix.sf.net