language agnostic - Eager load from disk into memory instead of page faulting multiple times -
lets have big file (or raw storage if possible in popular operating systems) on disk going need operate on. there way let operating system know entire chunk of data eagerly loaded memory rather having tiny chunk of loaded memory , page faulting every time try access segment hasn't been loaded memory yet? i'm thinking more memory mapped files, since operating system job of having things preloaded if doing sequential reads. i'm sure it's technically possible write operating system provides functionality looking for, exist in popular operating systems? also, operating systems preload entire block memory default if there ram available? if operating systems provide functionality, programming language support exists accessing functionality?
as commentators have pointed out, case of sequential reading, modern operating systems perform read-ahead optimisation you.
for other kinds of input, make use of asynchronous i/o.
if program knows need read data in future, not need immediately, dispatches request asynchronous input of data.
when program advances point needs data, examines state of asynchronous request.
if request has been satisfied, optimisation worked, , program can process requested data without blocking.
if request has not yet been satisfied, program blocks until data ready. although program still has block case, length of time blocked less case of synchronous i/o.
Comments
Post a Comment