Re: [Altosdev-kernel] Ehh.. Streams.. (fwd)
Status: Planning
Brought to you by:
dozz
From: Alexey M. <tkt...@cs...> - 2002-03-09 08:12:25
|
> Hello, dozzer. Hei, > I wonder what's so special about streams? Isn't it just another form > of what is known as IO control under DOS/Windows? If so, what are > advantages/disadvantages of the two? Do they have anything to do with > two channels (command and data ones)? Detailed explanation would be > nice =) . No, it is not the same. It is general purpose form of inter process communication which can be applied for device drivers and user applications. The main difference of stream is that it is demand to transfer data with correspondence to specefied binary protocol. The control channel transfers commands and data channel transfers raw data. You may imagine that stream is the pair of two sockets, but with different realization. The control channel needs to transfer small packets of control sequences, so it can be realized to be transfered as fast as it possible. The data channel can be realized in the common way as a common socket. The adventage of that layout is that we can receive commands and answer to it immediately don't waiting for whole data. Then we can receive next command even we din't read all data of previous command. The adventage of using unified form of interprocess communication. You can build common application where you send your's graphical representation to GUI, read files and write them -- all these you do through streams. The program (shell for example) which calls execve and performs your application can redirect your streams in any way.. the pepresentation can be redirected to machine A and application can be performed on machine B. If you'll create children processes and communicate with them through streams, they can be performed on different machines - and your application will know nothing about it. The streams help to create distributed applications. Let imaging more sophisticated example. You have machine A and machine B. Machine A has no mouse, machine B has two. When you load up drivers, you redirect stream from one on machine B to machine A. Now, for all applications on machine A mouse will be present. How to realize that in kernel - another question. -- See you later, d. +358 040 817 8540 |