From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 1C88BBB81 for ; Wed, 8 Dec 2004 21:05:03 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id iB8K52pr000371 for ; Wed, 8 Dec 2004 21:05:02 +0100 Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id VAA23106 for ; Wed, 8 Dec 2004 21:05:02 +0100 (MET) Received: from bernache.ens-lyon.fr (bernache.ens-lyon.fr [140.77.167.10]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id iB8K51qt026048 for ; Wed, 8 Dec 2004 21:05:02 +0100 Received: by bernache.ens-lyon.fr (Postfix, from userid 103) id A858F7ABD45; Wed, 8 Dec 2004 21:05:01 +0100 (CET) Received: from bryan.is-a-geek.org (unknown [84.97.241.83]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (Client did not present a certificate) by bernache.ens-lyon.fr (Postfix) with ESMTP id 248177ABD44; Wed, 8 Dec 2004 21:05:01 +0100 (CET) Received: by bryan.is-a-geek.org (Postfix, from userid 1000) id 586B59339A; Wed, 8 Dec 2004 21:04:59 +0100 (CET) Date: Wed, 8 Dec 2004 21:04:59 +0100 From: Julien Cristau To: caml-list@inria.fr Cc: david.baelde@ens-lyon.org Subject: mmap() and strings Message-ID: <20041208200458.GC1840@ens-lyon.fr> Mail-Followup-To: caml-list@inria.fr, david.baelde@ens-lyon.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.6+20040722i X-Miltered: at concorde with ID 41B75E6E.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 41B75E6E.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; ens-lyon:01 manipulates:01 buffer:01 buffer:01 iteration:01 ocaml:01 strings:01 pipes:02 seems:03 string:03 string:03 problem:05 problem:05 somebody:07 anybody:07 X-Spam-Checker-Version: SpamAssassin 3.0.0 (2004-09-13) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.0 X-Spam-Level: Hello list, I'm wondering if somebody has an idea for the following problem: I'm working on a program which manipulates a buffer. A writer process regularly changes this buffer, and reader processes have to work on it after each change. Currently, the buffer is a string and is passed to the readers trough pipes. However, this is costly because the buffer is copied many times at each iteration. We thought we could use mmap(2), but there seems to be no easy solution to mmap() a memory region and treat it as a string in ocaml. Does anybody have a better idea how we could solve this problem without copying the buffer? Julien