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 mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 2B3BDBC37 for ; Fri, 30 Oct 2009 01:43:59 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: At8BAPrS6UrU4366kGdsb2JhbACBT5l7AQEBAQkJDAcTA8MJAoQ7BA X-IronPort-AV: E=Sophos;i="4.44,649,1249250400"; d="scan'208";a="49492782" Received: from moutng.kundenserver.de ([212.227.126.186]) by mail4-smtp-sop.national.inria.fr with ESMTP; 30 Oct 2009 01:43:58 +0100 Received: from office1.lan.sumadev.de (dslb-094-219-209-052.pools.arcor-ip.net [94.219.209.52]) by mrelayeu.kundenserver.de (node=mreu1) with ESMTP (Nemesis) id 0LnFph-1MYAjJ1pO9-00gw9K; Fri, 30 Oct 2009 01:43:56 +0100 Received: from [192.168.5.104] (dslb-094-219-209-052.pools.arcor-ip.net [94.219.209.52]) by office1.lan.sumadev.de (Postfix) with ESMTPSA id 59A5EC0E8E; Fri, 30 Oct 2009 01:43:55 +0100 (CET) Subject: Re: [Caml-list] Re: How to read different ints from a Bigarray? From: Gerd Stolpmann To: Goswin von Brederlow Cc: Florian Weimer , caml-list@inria.fr In-Reply-To: <87r5sl3gxb.fsf@frosties.localdomain> References: <87eiond3of.fsf@frosties.localdomain> <87639zd0m9.fsf@frosties.localdomain> <87639yue6y.fsf@mid.deneb.enyo.de> <1256850244.24202.105.camel@flake.lan.gerd-stolpmann.de> <87r5sl3gxb.fsf@frosties.localdomain> Content-Type: text/plain Date: Fri, 30 Oct 2009 01:48:55 +0100 Message-Id: <1256863735.24202.127.camel@flake.lan.gerd-stolpmann.de> Mime-Version: 1.0 X-Mailer: Evolution 2.12.1 Content-Transfer-Encoding: 7bit X-Provags-ID: V01U2FsdGVkX18IalsyN/nQj7jccOr/+umuN/E4bdGiOTSQI9t BkWtvKARtVHiRtwkhWBgj0eYVkp4DSGJjPu7PiIGIryZTMt5rK jgVh1j2O1O8Sjc3jiBSWA== X-Spam: no; 0.00; bigarray:01 gerd:01 stolpmann:01 gerd:01 stolpmann:01 donnerstag:01 aligned:01 afaik:01 chunks:01 darmstadt:01 6151:01 6151:01 threads:01 threads:01 glibc:01 Am Freitag, den 30.10.2009, 00:43 +0100 schrieb Goswin von Brederlow: > Gerd Stolpmann writes: > > > Am Donnerstag, den 29.10.2009, 21:40 +0100 schrieb Florian Weimer: > >> * Goswin von Brederlow: > >> > >> > - The data is passed to libaio and needs to be kept alive and unmoved > >> > as long as libaio knows it. > >> > >> It also has to be aligned to a 512-byte boundary, so you can use > >> O_DIRECT. Linux does not support truely asynchronous I/O without > >> O_DIRECT AFAIK, which rarely makes it worth the trouble. > > > > Right. There is also the question whether aio for regular files (i.e. > > files backed by page cache) is continued to be supported at all - it is > > well known that Linus Torvalds doesn't like it. It can happen that at > > some day aio will be restricted to block devices only. > > > > So I wouldn't use it for production code, but it is of course still an > > interesting interface. > > > > Gerd > > Damn. That seems so stupid. Then writing asynchronous will only be > possible with creating a pot full of worker thread, each one writing > one chunk. So you get all those chunks in random order submitted to > the kernel, the kernel has to reorder them, fit them back together, > write them and then wake up the right thread for each piece > completed. So much extra work while libaio has all the data already in > perfect structures for the kernel. Well, this is exactly the implementation of the POSIX aio functions in glibc. They are mapped to a bunch of threads. > And how will you do barriers when writing with threads? Wait for all > threads to complete every time you hit a barrier and thereby stalling > the pipeline? You can't implement barriers. When you have page-cache backed I/O (i.e. non-direct I/O, no matter of aio or sync I/O) there is no control when data is written. Ok, there is fsync but this is very coarse-grained control. Gerd -- ------------------------------------------------------------ Gerd Stolpmann, Bad Nauheimer Str.3, 64289 Darmstadt,Germany gerd@gerd-stolpmann.de http://www.gerd-stolpmann.de Phone: +49-6151-153855 Fax: +49-6151-997714 ------------------------------------------------------------