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
appending data to a mmap-ed file
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2010-12-16 (12:58)
From: Gerd Stolpmann <info@g...>
Subject: Re: [Caml-list] appending data to a mmap-ed file
Am Donnerstag, den 16.12.2010, 11:31 +0000 schrieb Joel Reymont:
> I'm constantly appending to a file of stock quotes (ints, longs, doubles, etc.). I have this file mapped into memory with mmap. 
> What's the most efficient way to make newly appended data available as part of the memory mapping?

Generally, you can only unmap the old mapping, and remap it. Don't know
whether you have an OS preference - Linux has also mremap, and it would
at least be possible to create a binding for it. mremap is non-portable,

If you have all rights to define the file format yourself, I'd suggest
you use some kind of container, so you can append to the file in larger
chunks, and only when you need a new chunk, the mapping needs to be


> Obligatory OCaml content: I'm trying to prototype a trading system in OCaml.
> 	Thanks, Joel
> ---
> _______________________________________________
> Caml-list mailing list. Subscription management:
> Archives:
> Beginner's list:
> Bug reports:

Gerd Stolpmann, Bad Nauheimer Str.3, 64289 Darmstadt,Germany
Phone: +49-6151-153855                  Fax: +49-6151-997714