file buffering

file buffering

Post by Mats Larss » Sat, 11 Oct 1997 04:00:00



If You write programs in C You can manage file buffering via
setbuf/setvbuf or fflush.

Does UNIX have a buffering on it's own, meaning that even though You
use the mentioned functions You are not sure when buffers really
are flushed to disk.

TIA Mats.

 
 
 

file buffering

Post by Andrew Giert » Sat, 11 Oct 1997 04:00:00


 Mats> If You write programs in C You can manage file buffering via
 Mats> setbuf/setvbuf or fflush.

 Mats> Does UNIX have a buffering on it's own, meaning that even
 Mats> though You use the mentioned functions You are not sure when
 Mats> buffers really are flushed to disk.

Yes. As a general rule, when you write to a file, the physical update
on disk happens at some later time at the whim of the system.

There is usually some control over this, however, in the form of the
fsync() system call and/or O_SYNC flag to open().  The exact behaviour
is system-dependent (or even filesystem-dependent).  Some specialised
filesystems (e.g. vxfs) may have ioctls allowing even finer control
over physical updates, at the cost of tighter dependency between the
code and the platform and configuration used.

--
Andrew.

comp.unix.programmer FAQ: see <URL: http://www.erlenstar.demon.co.uk/unix/>
                           or <URL: http://www.whitefang.com/unix/>

 
 
 

1. Switching file buffering for particular files

Hello

On Solaris 7, one can mount a ufs file system with the option
"forcedirectio" to circumvent buffering of I/Os to the files in that
file system. Is it possible to mount the file system buffered but to
change the attributes of particular files (not all of them) in order
to behave as if forcedirectio would be used as an option?

Or perhaps the other way around: Mount the filesystem with the
forcedirectio option but exclude some files, allowing them to use the
file system buffer?

This is all aiming to find the impact of this option on the
performance of database work (Oracle 9.2.0.5/E3500+Storedge 1000).

Thanks
Rick Denoire

2. REQUEST: CTX-1562GM Monitor settings for X

3. file buffers usage on SVR4.0/MP

4. Memory not detected correctly

5. File buffering after fseek in 2.3

6. 3D Blaster Banshee on Linux?

7. Solaris/csh stdout > file buffering

8. Ghost{view,script} on Solaris 2.4?

9. fseek and file buffering under 2.3

10. Flushing of file-buffers

11. RAM file buffers.

12. cleaning file buffer cache

13. File buffering problems.