External Searching
External Searching
The process of accessing a task or sorting data from external storage (outside main memory) is
known as External Searching or External Memory Searching. External memory sources may
be a hard disk, a network file server with external storage, or a solid state disk. Data managed
from external sources to the main memory has speed as one of the main limiting factors. As
such, data has to be organized and accessed in a way that will optimize the ultimate speed of the
process.
In Internal search , data structure is kept in RAM but External search locates and retrieve records
stored in hard disks. B-trees are designed for external searches. B-trees stay in the hard disk.
Buffer : a buffer is a region of memory used to temporarily hold data while it is being moved
from one place to another.
I/O buffering The process of temporarily storing data that is passing between a processor and a
peripheral. The usual purpose is to smooth out the difference in rates at which the two devices
can handle data.
I/O Buffering
Unbuffered I/O
Data transfered from (to) user directly to (from) device (no intermediate storage)
Each read or write causes an actual (physical) I/O operation
run file manager and device handler for each transfer, could cause very high process
switching overheads (when transferring characters for instance - possible to get process
switch per character)
Not the best way - clearly - any alternatives ?
Buffered I/O
1. Single buffering:
When a user process issues an I/O request, the O.S assigns a buffer in the system portion
of main memory to the operation.
2. Double buffering
3. Circular buffer
Double buffering may be inadequate, if the process performs rapid burst of I/O. When
two or more buffers are used.
The collection of buffers is called as a circular buffer, with each buffer being one unit in
the circular buffer.