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=1.2 required=5.0 tests=AWL,MISSING_HEADERS, SPF_SOFTFAIL 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 E7D82BB84 for ; Tue, 17 Feb 2009 14:52:40 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Am8DAAxQmknBM2RkmWdsb2JhbACNBoYfgSEBAQEBAQgLCgcRvTeEEwY X-IronPort-AV: E=Sophos;i="4.38,223,1233529200"; d="scan'208";a="21232764" Received: from ultra1.univ-paris12.fr ([193.51.100.100]) by mail2-smtp-roc.national.inria.fr with ESMTP; 17 Feb 2009 14:52:40 +0100 Received: from [194.214.15.155] (localhost [127.0.0.1]) by ultra1.univ-paris12.fr (8.13.8/8.13.8) with ESMTP id n1HDqdCk007299 for ; Tue, 17 Feb 2009 14:52:40 +0100 (MET) Message-ID: <499AC12C.4030600@univ-paris12.fr> Date: Tue, 17 Feb 2009 14:52:44 +0100 From: =?UTF-8?B?RnLDqWTDqXJpYyBHYXZh?= Reply-To: gava@univ-paris12.fr Organization: =?UTF-8?B?VW5pdmVyc2l0w6kgZGUgUGFyaXMgMTIsIExBQ0w=?= User-Agent: Thunderbird 1.5.0.14ubu (X11/20080505) MIME-Version: 1.0 Cc: caml-list@inria.fr Subject: Re: [Caml-list] Re: Threads performance issue. References: <2184b2340902160715y1f935b5ehc0e6195b3f75b66b@mail.gmail.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; gava:01 gava:01 non-blocking:01 ric:98 12.:98 discs:98 threads:01 threads:01 caml-list:01 linking:02 native:03 threaded:03 library:03 blocking:04 thread:06 >> I would like to read two files in two different threads. >> >> I have made a first version reading the first then the second and it takes >> 2.8s (native). >> >> I decided to make a threaded version and before any use of thread I realize= >> d >> that just linking no even using it to the threads library makes my first >> version of the program to run in 12s ! This kind of trick can work when files are on different discs due to two I/O calls (even using blocking reading). But in a single thread using non-blocking reading should also work but it is more difficult to write. FG