Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 11 Jul 2006 @ 12:23:56 GMT


     
  <Prev Next>   <<First <Prev
Next>
Last>>
 


Subj:   Re: Basics of Named Pipes
 
From:   McCall, Glenn David

A named pipe is a FIFO (First In First Out) queue.

It is used for inter-process communication. Two processes can use a named pipe to transfer data between them. One produces data and one consumes data.

An might be of a service producing data and placing it on a named pipe with a tpump job consuming the data as it is loaded to Teradata.

On Unix they appear and operate very much like files (except you need two processes - one to write data and another to read from it). They exist as entries in directories. But they don't occupy any disk space.

On windows they don't occupy any disk space either, but they don't appear as files in a directory - there are special API's that must be used to create them and access them.

On Unix, you can try the following command sequence using two terminal sessions to see how they work.

     Terminal 1                 Terminal 2        Comment
     mknod mypipe p
     cat somefile >mypipe                         The terminal "hangs"
                                cat mypipe        Content of somefile displayed

The above sequence creates a named pipe called mypipe. Then a file called "somefile" is sent to the named pipe. At this point the terminal seems to hang because nothing is reading the data from the other end of the pipe.

On terminal 2, we display the content of the pipe which is relaying the output of the command running on terminal 1. You can use any command you like on either terminal. For example, you could use ls -l on terminal 1 and sort on terminal 2 if you wished.

Named pipes - simple as that.


Hope this helps

Glenn Mc



     
  <Prev Next>   <<First <Prev
Next>
Last>>
 
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023