STREAMS
STREAM – a full-duplex communication channel between
a user-level process and a device driver.
A STREAM consists of:
- STREAM head interfaces with the user process
- driver end interfaces with the device
- zero or more STREAM modules between them.
Each module contains pair of queues a read queue and a
write queue.
Message passing is used to communicate( transfer data)
between queues.
Modules provide the functionality of STREAMS processing
and they are pushed onto a stream using the ioctl ()
system call.
Benefit:
It provides a framework to a modular and incremental
approach to writing device drivers and network protocols.
The STREAMS Structure
Performance
I/O is a major factor in system performance:
Demands CPU to execute device driver, kernel I/O code
Context switches due to interrupts
Data copying between controllers and physical memory ,
and again during data copy between kernel buffers and
application data space.
Network traffic especially stressful
Intercomputer Communications
Improving Performance
Reduce number of context switches
Reduce the number of times that data must be copied in
memory while passing between device and application.
Reduce the frequency of interrupts by using large
transfers, smart controllers, polling
Increased concurrency by using DMA
Balance CPU, memory, bus, and I/O performance for
highest throughput
Device-Functionality Progression