You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As I know, fdatasync is more efficient than fsync which used in *os.File.Sync().
Because fdatasync don't update metadata of file if unnecessary.
And there is no direct func in *os.File, just use syscall.Fdatasync().
And the way to write to file in diskqueue should be rewrite a lot for fixing metadata of file first.
Besides, I love to do this work, but it's awkward that I'am just stuck in how to create a file with the size being set at the same time.
The text was updated successfully, but these errors were encountered:
Ok, I mean in some extremely biz-logic situation, Sync file every time you write data to it, should use fdatasync. But apparently, bitly just Sync file after syncEvery times writing opertions. ThissyncEvery could be 1000, in which case, there is no difference between fdatasync and fsync . And I think, there is no need to synchronize file too. why not just use the autoflush mechanism of os itself?
@hardPass we did this to give some control to the user to configure the flushing behavior. we should actually have another config option to bound it by time, too.
As I know, fdatasync is more efficient than fsync which used in *os.File.Sync().
Because fdatasync don't update metadata of file if unnecessary.
And there is no direct func in *os.File, just use syscall.Fdatasync().
And the way to write to file in diskqueue should be rewrite a lot for fixing metadata of file first.
Besides, I love to do this work, but it's awkward that I'am just stuck in how to create a file with the size being set at the same time.
The text was updated successfully, but these errors were encountered: