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.3 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 mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 67F6DBC6B for ; Tue, 18 Sep 2007 10:58:26 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAKow70bAXQInlGdsb2JhbACOEAICBwQGBwg X-IronPort-AV: E=Sophos;i="4.20,267,1186351200"; d="scan'208";a="16353774" Received: from concorde.inria.fr ([192.93.2.39]) by mail4-smtp-sop.national.inria.fr with ESMTP; 18 Sep 2007 10:59:30 +0200 Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l8I8wt8N031909 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Tue, 18 Sep 2007 10:58:56 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAKow70ZQW+UCh2dsb2JhbACOEAIJCic X-IronPort-AV: E=Sophos;i="4.20,267,1186351200"; d="scan'208";a="1346830" Received: from main.gmane.org (HELO ciao.gmane.org) ([80.91.229.2]) by mail2-smtp-roc.national.inria.fr with ESMTP; 18 Sep 2007 10:59:29 +0200 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1IXYvT-0003QF-Kk for caml-list@inria.fr; Tue, 18 Sep 2007 10:59:23 +0200 Received: from ivr94-8-88-162-26-239.fbx.proxad.net ([88.162.26.239]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 18 Sep 2007 10:59:23 +0200 Received: from li by ivr94-8-88-162-26-239.fbx.proxad.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 18 Sep 2007 10:59:23 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: caml-list@inria.fr From: Zheng Li Subject: Re: [ANN] coThreads 0.10 Date: Tue, 18 Sep 2007 11:01:02 +0200 Message-ID: <87y7f473g1.fsf@pps.jussieu.fr> References: <87lkb5fe3f.fsf@pps.jussieu.fr> <20070918121041.6683b111.mle+ocaml@mega-nerd.com> <1190095167.22073.54.camel@rosella.wigram> <20070918162347.e04ac421.mle+ocaml@mega-nerd.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: ivr94-8-88-162-26-239.fbx.proxad.net User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/23.0.50 (gnu/linux) Cancel-Lock: sha1:22uSaQShwWTt9MHp2OTrOe54bV0= Sender: news X-Miltered: at concorde with ID 46EF934F.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ocaml:01 errno:01 hackery:01 bug:01 bug:01 largefile:01 lseek:01 largefile:01 0.10:98 wrote:01 unix:01 pps:01 pps:01 jussieu:01 jussieu:01 Hi, Erik de Castro Lopo writes: > skaller wrote: > >> But it isn't an errno value that is reported, it is the index >> of the variant that is 12, and that is "Invalid Argument". > > Ok. > >> It is not clear that a seek to an invalid position in the file >> is going to succeed. It's also not clear to me that the seek >> argument isn't 32 bits (depends on complex ugly GNU macro >> hackery what type off_t is .. my Caml got built with >> the LARGE_FILE macro thing so it should be 64 bits). > > Shouldn't off_t always be 64 bits on a 64 bit CPU? I only see > this problem on x86-64 and Sys.word_size is 64. Thank you for the bug report. Unfortunately I don't have a x64 machine to test, and know quite little about 64bit machine (that's why I made the mistake). But the bug reason seems obvious: on a x64 machine, one have to use Unix.LargeFile.lseek to seek the address in the extra space. On the other hand, I think 2^14 locks (the x86 case) are fairly enough in most situation. So we don't have to bother with Int64 and LargeFile. Could you (or anyone else with a x64 machine) help to test the simple solution: change "Sys.word_size - 2" in the definition of "fresh_number" to "(min Sys.word_size 32) - 2" as follows let fresh_number = let usable_size = (min Sys.word_size 32) -2 in let bits_of_id = 16 in (* Should be sufficient in most OS *) ........ and report whether it works? Thanks -- Zheng Li http://www.pps.jussieu.fr/~li