I know for sure that NT do it's own buffering and I think you are right also for other OS. So how come that there is an improvement at all? I can not find any code for the flush() in the java source and no native call as well. Is flush() really doing something useful?
Keep in mind that flush() don't forth the OS to write to disk immediately. This is only achieved by using sync() on a file handle. If using sync() there is a degree by an order of magnitude or two. Regards Frank-Olaf Lohmann >>> "Wolf Siberski" <[EMAIL PROTECTED]> 05.06.2002 11.33 Uhr >>> An explanation for the small difference is that write buffering occurs also on other levels in modern hardware/operating systems: - filesystems buffer data before writing chunks to the disk - the disk itself buffers in memory before actually persisting the data. This may not be the case for all hardware/OS combinations. For example I would expect larger differences on PDAs. Wolf > Ceki G�lc� wrote: > > At 10:54 05.06.2002 +0200, zze-pegase balg011 Bancharel Fabien > DvSI/SIReS/GRE wrote: > > > // join the last created thread. It is likely to be the last > > > // thread to finish, although that is not certain. We wait another > > > // 5 secs just in case. > > > io.join(); > > > Thread.currentThread().sleep(5000); > > > >YES, this is REALLY not certain that the last started thread will be the > >last to finish. > >And as the whole process for one test must be about 40 secondes, > >it is not sure at all that waiting 5 secondes is sufficient to be sure > >that the next test is not started while the current one is not finished. > > Good point. > > >As the buffered IO test is the last one, > >it can suffer most of this risk. > > More of the same point but still a good point. > > >Maybe the results would be different by starting with the Buffered IO test. > > > >Anyway, even if the gain doesn't appear obvious here, > >the buffered IO saves lot of CPU time. > > Buffered IO reducing CPU load is an interesting hypothesis. > > I modified IO.java so that it now has two threads logging and another > thread doing some CPU intensive operation. > [snip] -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
