Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: OT: shell and output redirection

Re: OT: shell and output redirection

From: Tim Gorman <tim_at_sagelogix.com>
Date: Sat, 03 Jul 2004 19:22:26 -0600
Message-ID: <BD0CB7F2.17B56%tim@sagelogix.com>


As Mladen said, the programs execute simultaneously, but "program-b" will block on its read from "stdin" until "program-a" places something into the memory buffer of the pipe.

Likewise, "program-a" will block on writes to "stdout" if the volume of data written to the memory buffer of the pipe tries to exceed the size of the buffer (i.e. 8-32Kb on most *nixes).

It's a beautiful (and transparent) mechanism for which someone should have received a Nobel Prize. Since it sometimes takes 35-45 years for a Nobel to be awarded, maybe it's on its way?

on 7/2/04 1:04 PM, Mladen Gogala at mladen_at_wangtrading.com wrote:

>
> On 07/02/2004 02:50:44 PM, Tanel P?der wrote:

>> Hi!
>> 
>> When I redirect output from program a to program b using a shell pipe, when
>> is the receiving procedure executed?

>
> Programs are executed simultaneously. Pseudocode goes like this:
> create pipe
> fork process 1 {
> open pipe for output
> exec program 1 }
> fork process 2 {
> open pipe for input
> exec program 2 }
>
> wait for the first one to complete.


Please see the official ORACLE-L FAQ: http://www.orafaq.com

To unsubscribe send email to: oracle-l-request_at_freelists.org put 'unsubscribe' in the subject line.
--
Archives are at http://www.freelists.org/archives/oracle-l/
FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------
Received on Sat Jul 03 2004 - 20:18:25 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US