Silverfrost Forums

Welcome to our forums

do you find windows10 disc usage goes to 100% while reading?

11 Sep 2017 6:04 #20193

if you do, it might be caused by switching open datafiles too often.

e.g.

do nu=7,20 open(nu) end do

!this causes 100% disk access do jrec=1,100 do nu=7,20 read(nu, rec=jrec) data end do end do

!this doesn't do nu=7,20 do jrec=1,100 read(nu, rec=jrec) data end do end do

K

4 Jan 2018 9:35 #21067

I would venture to say that the second example (not 100%) is because there is a buffer that is being filled, and only 1 (or a small number) of actual I/O being performed on each file.

The former example likely requires that the input be 'flushed' for each record from a different file, so you are getting, in essence, 1400(+) I/O operations.

Many I/O systems will pre-buffer input data because it it as efficient to read multiple sectors from a file as it is to read one sector.

Similarly, buffering output data is done again to reduce the I/O calls to the operating system.

Please login to reply.