1 / 10

Pipe and Filter Group 2

Pipe and Filter Group 2. Shimirrah Rembert Christoper Bell Adedoyin Oke Brian Adiyiah Breland Branch. What is pipe and Filter.

washi
Download Presentation

Pipe and Filter Group 2

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Pipe and Filter Group 2 ShimirrahRembert Christoper Bell AdedoyinOke Brian Adiyiah Breland Branch

  2. What is pipe and Filter Also known as pipelineThis is the process of chain of events, where the output of an element is the input of the next elementIn between these elements there are flowsFilter- Transforms the data through the pipes that it is connected to. A filter can have as many pipes as need be.Pipe – passes data from one filter to the nextFilters work at the same time with different assignmentsFilters can be combined

  3. Pipe and Filter Overview Other componentsPump- The data source or the producerSink- The data target or the consumerKEN Thomson- Creator of unixThomson limited the architecture of linear pipeline along with Doug McIlroy.

  4. High level diagram

  5. UNIX STYLE EXAMPLE $ doyin | lpr –PclJ263 The | is a Unix pipe symbol used in command line. The standard output of the command to the left of the pipe gets sent as standard input of the command to the right of the pipe. It sends the stream of data to another program, in this case, a program called lpr which sends all incoming data to the printer in CLJ263.

  6. More example of pipe in Unix command line $ cat GROUP2.txtinputstring shell signal $ cat Group2.txt | wc3 4 2 6In this example, at the first shell prompt, the contents of the file GROUP2.txt are displayed.HeRE thecat command is used to display the contents of the GROUP2.txt file, but the display is not sent to the screen; it goes through a pipe to the wc (word count) command.The wc command then does its job and counts the lines, words, and characters of what it got as input.

  7. EXAMPLE of FILTERS IN UNIX FILTERS DOES SOME MANIPULATION TO TEXT OF A FILE.UNIX FILTERS USED ARE SED , AWK AND GREP$ cat GROUP2.txt inputstring shell signal$ cat GROUP2.txt | sed -e "s/string/signal/g“ inputsignal shellsignal In this example, the first shell prompt displays the contents of the GROUP2.txtfile.The second shell prompt, uses the cat command to display the contents of the GROUP2.txt file, and sends that display through a pipe to the sed command.The sedcommand changed every occurrence of the word "string" to the word "signal.“The sed took as input the information it got through the pipe.The sed command displayed its output to the screen.

  8. MORE SED EXAMPLE $ cat GROUP2.txt | sed -e "s/i/ooo/“WWWnputstrooongshelLsooognal $ The shell prompt, uses the cat command on the GROUP2.txt file and pipes the output TO THE SED COMMAN TO CHANGE THE FIRST OCCURRENCE OF AN “I” ON EACH LINE TO “ooo”the contents of the GROUP2.txt file itself were not changed in the file. Only the display of its contents changed.ANOTHER FILTER EXAMPLE IS GREP COMMAND WHICH IS USED TO SEARCH FOR A PARTICULAR STRING IN A FILEJohn S. Gray 1997. “ Interprocess Communications in UNIX .” The Nooks and Crannies, Dec, 1997.

  9. Advantages Description of the design of pipe and filter can be done in various ways and have several pathsHas back-up with 3 components: pump, filter, sink.Helps eliminate deadlocks in the operating systemthe FILTER AND SYSTEM BENEFIT EACH OTHERNo restrictive order in the designIndependent filtersHelps the binding of a real time systemPipe and filter are efficient and parallel

  10. Disadvantages Doesn’t work will with systems that interact with usersPipe and filter architecture is a type of directed acyclic graphFilters cannot communicate with other components in a program directlyConsumes a large mass of energyconcurrent running transpires

More Related