I was wondering when it is appropriate to flush the file IO? I have a program which does it every 10 seconds along with a progress update. The problem is that when the flushes are called (and it's generating about 200 k / s), it takes quite a while.
The loop goes something like this:
processing (parsing) in memory
and this happens every ten seconds.
Seems to be that about half or two thirds of the time is spent in processing and a third of the time or so. Again it is generating a lot of data, however I don't see why the computer doesn't just send a signal to the file IO subsystem for the flush and continue processing right away.
By the way, I'm doing this in Java (please don't ask why, for development purposes this was a much better decision), and am using FileWriter.
Thanks, and nice to back here with some programming questions for once.