Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: OT: shell and output redirection
communications files, unknown math major (although it was probably Sidney
Marshall), Dartmouth College, circa 1965, Dartmouth Time Sharing System,
Kemeny & Kurtz, et. al. "everything is a file"
-----Original Message-----
From: oracle-l-bounce_at_freelists.org
[mailto:oracle-l-bounce_at_freelists.org]On Behalf Of Tim Gorman
Sent: Saturday, July 03, 2004 9:22 PM
To: oracle-l_at_freelists.org
Subject: Re: OT: shell and output redirection
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.
-- Archives are at http://www.freelists.org/archives/oracle-l/ FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html ----------------------------------------------------------------- ---------------------------------------------------------------- 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:52:29 CDT