[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: dvd+rw-tools update [6.0, DVD-R DL]



Bill Davidsen <davidsen@tmr.com> wrote:

> >I was thinking that a simple wrapper to open() which adds
> >O_DIRECT might be sufficient, but it turned out that this
> >alone is not sufficient: the buffers used by the programs
> >must have a certain alignment. This is not guaranteed
> >without modifying the way how those programs allocate
> >memory.
> >
> >  
> >
> I played with this a bit, if you are using higher level calls you can 
> replace fopen() with an open() using O_DIRECT, an fdopen() after that, 
> and a setbuffer() to get a big alligned buffer in place. I did that just 
> to see if I could get a gain without doing a bunch of code which might 
> be non-portable in practice. The main benefit was to have less impact on 
> the rest of the system, the i/o in the program didn't run that much faster.

O_DIRECT is no standard and it seems that it is just a reimplementation of the 
very old DG/UX idea of O_DG_UNBUFFERED.

Note that what you get with this feature is less than what you get from a
decent VM & buffer subsystem. 

When I added O_DG_UNBUFFERED support into star 11 years ago, it turned out that
DG/UX with O_DG_UNBUFFERED was still _much_ slower than reading from a standard 
fd on Solaris.

Jörg

-- 
 EMail:joerg@schily.isdn.cs.tu-berlin.de (home) Jörg Schilling D-13353 Berlin
       js@cs.tu-berlin.de                (uni)  
       schilling@fokus.fraunhofer.de     (work) Blog: http://schily.blogspot.com/
 URL:  http://cdrecord.berlios.de/old/private/ ftp://ftp.berlios.de/pub/schily



Reply to: