Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 8 Jan 2002 09:41:50 +0100
From:      Robert Suetterlin <robert@mpe.mpg.de>
To:        freebsd-questions@freebsd.org
Subject:   Q: mmap+ftruncate or write for large linear writes?
Message-ID:  <20020108084150.GA2582@robert2.mpe-garching.mpg.de>

next in thread | raw e-mail | index | archive | help
Hi!

	I currently rewrite a data aquiaition program of ours.  It does some 60MByte/sec, currently using write(2).  Data is stored in a ringbuffer by data aquisition hardware.  I am currently reconsidering which commands to use to do the transfer of data to file.  I looked at writev, aio_write and mmap+ftruncate.

mmap+ftruncate sounds quite promising, but mmap specifically discurrages using it for large linear writes on ftruncated files.  It recommends to fill the file with zeros before mmaping.  But ftruncate's man page specifically states it would grow the file 'as if filled with zeros'.  I guess this just refers to what You get if You'd read the ftruncated file.

What would be Your recommendation on this task.  BTW there is no hidden information or special trick here, I just have to write 60MByte/sec and write(2) can do the job.  I just wanted to make up my mind on the topic.

Regards, Robert S.

-- 
Robert Suetterlin (robert@mpe.mpg.de)
phone: (+49)89 / 30000-3546   fax: (+49)89 / 30000-3950

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020108084150.GA2582>