Andreas Beck wrote:
> > > I just tried the "documented" solution:
> > > write(1,buffer,width*height*2); fdatasync(1);
> > Agh!  That is not what fdatasync(1) is for!
> 
> What else would it be for ? It in deed does make sure that the file actually
> gets written to disk, what lets me synchronize with the disk speed.
> 
> What would you suggest to use ? fsync seems worse.

Well, not really... From sys_fdatasync:
        /* this needs further work, at the moment it is identical to
fsync() */
        down(&inode->i_sem);
        err = file->f_op->fsync(file, dentry);
        up(&inode->i_sem);

> The problem with both functions is, that their required runtime is of the
> order of the total file size, not the change file size.
> 
> This causes my framerate to drop from full 25fps down to 4 fps after about
> 600 frames. ARGL.

How about just mmap()ing enough of the file to hold a few frames and
then munmap() it when those frames are written to the buffer?
Or are buffers not flushed on munmap?

Otherwise the only solution I can think of is periodicly calling 
fdatasync() from another thread or process.

//Marcus
-- 
-------------------------------+------------------------------------
        Marcus Sundberg        | http://www.stacken.kth.se/~mackan/
 Royal Institute of Technology |       Phone: +46 707 295404
       Stockholm, Sweden       |   E-Mail: [EMAIL PROTECTED]

Reply via email to