realbasic-plugins
[Top] [All Lists]

Re: Double-buffering read/write to files

To: REALbasic Plugins <realbasic-plugins at lists dot realsoftware dot com>
Subject: Re: Double-buffering read/write to files
From: Menneteau <fmteau at Club-Internet dot fr>
Date: Mon, 11 Dec 2006 21:26:38 +0100
Delivered-to: listarchive at realsoftware dot com
Delivered-to: realbasic-plugins at lists dot realsoftware dot com
References: <557C772B-523C-457F-9A99-D5E7A0628387 at elfdata dot com> <60300C4A-3D6E-489F-8BAB-AC98685A9DBE at elfdata dot com>
Theodore H. Smith wrote:
Also, anyone know anything about double-buffering file streams?

So, basically, how I'd like it to work, is that ask for a read into the buffer, and return instantly before the read is complete! The user will process a previously made buffer. By the time he's finished processing it, the last read will be complete. If not, we'll actually just block until the read is complete.

Does fread offer such functionality? OR any standard Unix calls?

fread not, but read yes.
You control the read behavior with fcntl.
Basically, you can make the read asynchronous (O_NONBLOCK), you can be notified when data is available (O_ASYNC), and you can disable data caching (F_NOCACHE). This should work on Unix and Mac OS. I don't know how this works for windows.

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>