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.2 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 mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 05A8BBB84 for ; Thu, 11 Sep 2008 17:50:54 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AiUCAMzayEjAXQImiGdsb2JhbACSZgEBAQ8gpUaBZA X-IronPort-AV: E=Sophos;i="4.32,381,1217800800"; d="scan'208";a="14837224" Received: from discorde.inria.fr ([192.93.2.38]) by mail2-smtp-roc.national.inria.fr with ESMTP; 11 Sep 2008 17:50:53 +0200 Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id m8BFor9j029011 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Thu, 11 Sep 2008 17:50:53 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhsBAETbyEhQW+UCgWdsb2JhbACSZgEBECAEpTyBZA X-IronPort-AV: E=Sophos;i="4.32,381,1217800800"; d="scan'208";a="16839973" Received: from main.gmane.org (HELO ciao.gmane.org) ([80.91.229.2]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/AES256-SHA; 11 Sep 2008 17:50:52 +0200 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1KdoRX-0002LY-8u for caml-list@inria.fr; Thu, 11 Sep 2008 15:50:51 +0000 Received: from ks300734.kimsufi.com ([91.121.65.225]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 11 Sep 2008 15:50:51 +0000 Received: from sylvain by ks300734.kimsufi.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 11 Sep 2008 15:50:51 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: caml-list@inria.fr From: Sylvain Le Gall Subject: Re: ocamlnet and kernel poll Date: Thu, 11 Sep 2008 15:50:43 +0000 (UTC) Message-ID: References: <01677251-3A8D-4DCA-9E39-7D17FAC92645@gmail.com> <20080911143735.EF7EC29B2A@kicki.hq.vtech> <43AB5EFE-44FF-47AB-818E-F27DD03823AE@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: ks300734.kimsufi.com User-Agent: slrn/pre0.9.9-102 (Linux) Sender: news X-Miltered: at discorde with ID 48C93E5D.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; le-gall:01 ocamlnet:01 markus:01 mottl:01 markus:01 ocaml:01 ocaml:01 non-blocking:01 threads:01 wrote:01 wrote:01 suggesting:02 kernel:02 buffers:04 blocking:04 On 11-09-2008, Joel Reymont wrote: > > On Sep 11, 2008, at 4:32 PM, Markus Mottl wrote: > >> Use bigstrings as buffers and >> perform I/O outside of the OCaml-lock if releasing it (depends on >> I/O-size) is more efficient. > > Are you suggesting using multiple OS threads within a single process? > > When exactly do you release the lock and how do you perform IO outside > of it? > > How do you determine whether to release the lock or not? > I tink Markus is talking about the lock of the OCaml GC. When you do a potentially long syscall (like select, read...) the GC lock is released letting other OCaml thread running. Look at enter_blocking_section()/leave_blocking_section() in C part of OCaml source. You will still have 1 OCaml thread running but many other thread in C call can also be running. In particular, it means that OCaml thread can be used for standard "non-blocking" syscall replacement. Regards, Sylvain Le Gall