Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
mmap() and strings
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-12-08 (20:05)
From: Julien Cristau <julien.cristau@e...>
Subject: mmap() and strings
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?