I
was wondering if anyone has information on the use of event programming
for file I/O? I know in the Python/Twisted world there is a belief that
event level programming on file i/o is a waste - that you might just as
well do normal blocking opens/read/write/close since the kernel will do
most of the heavy lifting. Does any one know if this is true?
It's mostly true for the area of interest here, because storage I/O is
just so much faster than network I/O for the kinds of small machines
we're generally talking about. When you start talking about *serious*
storage I/O, though, asynchronous/overlapped operation becomes just as
important as for network I/O. Then it becomes a question of whether
your application's data (read data plus recently-written data) fits in
memory and can afford to sit there for a while before it's flushed back
to disk. If so, then yes, the OS will do most of the heavy lifting for
you. For large datasets or writes that must go to stable storage before
being considered done (e.g. database journals) you'll find many of the
same approaches are necessary as for network I/O. The really nasty case
is when you're doing I/O through the virtual-memory system, in which
case you've largely lost control over how it's done and have to trust
that the OS will do a good job. This is why VM systems are a major
differentiator between OSes and often a subject of such heated debate.
_______________________________________________
p2p-hackers mailing list
[email protected]
http://lists.zooko.com/mailman/listinfo/p2p-hackers