Aidan Van Dyk wrote:
One possibility would be to "double-buffer" the write... i.e. as you
calculate your CRC, you're doing it on a local copy of the block, which
you hand to the OS to write...  If you're touching the whole block of
memory to CRC it, it isn't *ridiculously* more expensive to copy the
memory somewhere else as you do it...

Coming in to this late - so apologies if this makes no sense - but doesn't writev() provide the required capability?

Also, what is the difference between the OS not writing the block at all, and writing the block but missing the checksum? This window seems to be small enough (most of the time being faster than the system can schedule the buffer to be dumped?) that the "additional risk" seems theoretical rather than real. Unless there is evidence that writev() performs poorly, I'd suggest that avoiding double-buffering by using writev() would be preferred.

Cheers,
mark

--
Mark Mielke <[EMAIL PROTECTED]>


--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to