boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Unix版 - Re: Thank you and.Re: a question about lower IO
相关主题
I/O implementation question
如何设置一机多屏???
regular expression中回车用什么表示?
emacs下如何switch buffer?
【贴图】这个人的Emacs + GDB 是怎么做出来的? (转载)
还是只认3.6G内存,大虾分析一下把 (转载)
[转载] anyone gives me a hint on HostID.
please help
unix pine下面写信是什么command
[转载] 请教Sun Ultra 1 上的外置SCSI硬盘
相关话题的讨论汇总
话题: io话题: os话题: about话题: data
进入Unix版参与讨论
1 (共1页)
n******t
发帖数: 4406
1

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This is not true.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
why do you need to force it?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The diefference should be trivial.
p******f
发帖数: 162
2
of course write() is buffered, the data is buffered in the OS memory.
while with fwrite(), the data is buffered on the user application
level first, then passed to OS via write().
w**n
发帖数: 88
3
This , you never know for sure, sometimes yes sometimes no. the system
usually has a daemon process periodcally update the system buffer to
harddisk (i.e. 30 seconds).
you should read about some database application's recovery scheme if
your target is reliable IO -- it is not a simple issue at all.
p******f
发帖数: 162
4
fflus() just sends the data to OS buffer, as white(), it does not touch
phisical hard disk.
as wien suggested, some systems are doing background fsync at about 30
sec frequency, if you feel you can't afford 30 second data lost, you
at do a fsync every 10, or 5 or 1 seconds. adjust the intervals to find
the best frquency.
BTW, are you worring about application crash or OS crash, IIRC, the data
in OS buffer will not lost even if your application crashed.
maybe, your concern is data integrity, the
p******f
发帖数: 162
5

As I said, you do not have to worry about application crash,
'cause OS buffered data will not lost in such occasions.
fsync() only forces OS level data flush to disk, you have to write()
or fflush() first.
l****y
发帖数: 18
6
Actually, I think there is always a conflict between realibility and performance.
you always want to buffer much data enough b4 make a fsync() request, then it
causes the reliablity problem
If you are REALLY serious about this, My suggestion is to use NVRAM (non-
violate RAM) it won't lose any data even when there is a power-off. for further
reading:
http://citeseer.nj.nec.com/hitz95file.html
n******t
发帖数: 4406
7
this is not a real buy.
Why need to sync it?
you need to focus on what you have surely written.
1 (共1页)
进入Unix版参与讨论
相关主题
[转载] 请教Sun Ultra 1 上的外置SCSI硬盘
link 一问
solaris mem monitor
Re: sparc 20 would be under $50 soon with the speed of price drop of e
help!!!!!!!!!!!!!!!!!!!!
Solaris 8 for intel can not be installed in P4?
[转载] How can I mount local HD from Server?
Help: Virtual memory exceeded...
HELP: Why the disk load is always so high?!
开始喜欢SUN了
相关话题的讨论汇总
话题: io话题: os话题: about话题: data