RE: OT: shell and output redirection

  • From: "Mark W. Farnham" <mwf@xxxxxxxx>
  • To: <oracle-l@xxxxxxxxxxxxx>
  • Date: Sat, 3 Jul 2004 21:55:47 -0400

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@xxxxxxxxxxxxx
[mailto:oracle-l-bounce@xxxxxxxxxxxxx]On Behalf Of Tim Gorman
Sent: Saturday, July 03, 2004 9:22 PM
To: oracle-l@xxxxxxxxxxxxx
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@xxxxxxxxxxxxxxx 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@xxxxxxxxxxxxx
put 'unsubscribe' in the subject line.
--
Archives are at //www.freelists.org/archives/oracle-l/
FAQ is at //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@xxxxxxxxxxxxx
put 'unsubscribe' in the subject line.
--
Archives are at //www.freelists.org/archives/oracle-l/
FAQ is at //www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------

Other related posts: