The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
* [TUHS] v3 pipes
@ 2020-04-25 11:14 Paul Ruizendaal
  2020-04-25 17:54 ` Paul Winalski
  0 siblings, 1 reply; 4+ messages in thread
From: Paul Ruizendaal @ 2020-04-25 11:14 UTC (permalink / raw)
  To: TUHS main list

[-- Attachment #1: Type: text/plain, Size: 1017 bytes --]

>> why the single fd approach was abandoned? To its credit, it appears to allow for limited 2-way communication.
> My understanding is that the single file descriptor broke the open-file
> model, which had a single read/write pointer. Two-way communication via

I’m not sure I understand.

In the implementation, the read pointer is file location offset (“fp->f_offset”) and the write pointer is the file size (“ip->i_size”). The location offset on the writing end of the pipe is always zero, and on the reading end it moves between zero and PIPSIZ (but that is unobservable).

I just tried making both pipe ends readable+writeable in my “V6.5” kernel and that appears to work. It allows for bi-directional communication in a half-duplex sense (i.e communicating walky-talky style). The other benefit is using just one file descriptor, at a time when a process had just 15 to work with.

Maybe the issue was that two sides writing to a full pipe at the same time will cause deadlock?





[-- Attachment #2: Type: text/html, Size: 1818 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [TUHS] v3 pipes
  2020-04-25 11:14 [TUHS] v3 pipes Paul Ruizendaal
@ 2020-04-25 17:54 ` Paul Winalski
  0 siblings, 0 replies; 4+ messages in thread
From: Paul Winalski @ 2020-04-25 17:54 UTC (permalink / raw)
  To: Paul Ruizendaal; +Cc: TUHS main list

On 4/25/20, Paul Ruizendaal <pnr@planet.nl> wrote:
>
> I just tried making both pipe ends readable+writeable in my “V6.5” kernel
> and that appears to work. It allows for bi-directional communication in a
> half-duplex sense (i.e communicating walky-talky style). The other benefit
> is using just one file descriptor, at a time when a process had just 15 to
> work with.

If both pipe ends are readable+writeable, you have the Unix equivalent
of VMS mailboxes.  There's lots of opportunity for both deadlock and
livelock, and some "broken pipe" situations become difficult or
impossible to detect.

-Paul W.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [TUHS] v3 pipes
@ 2020-04-24 12:54 Doug McIlroy
  0 siblings, 0 replies; 4+ messages in thread
From: Doug McIlroy @ 2020-04-24 12:54 UTC (permalink / raw)
  To: tuhs

>  why the single fd approach was abandoned? To its credit, it appears to allow for limited 2-way communication.

My understanding is that the single file descriptor broke the open-file
model, which had a single read/write pointer. Two-way communication via


Doug

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [TUHS] V3 pipes
@ 2020-04-23 13:48 Paul Ruizendaal
  0 siblings, 0 replies; 4+ messages in thread
From: Paul Ruizendaal @ 2020-04-23 13:48 UTC (permalink / raw)
  To: TUHS main list

Was looking into pipes.

For the 3rd Edition TUHS does not have source, but is does have a man page. In V3, pipe returns a single file descriptor that echoes whatever is written back upon reading. The pipe buffer capacity is 504 bytes.

The surviving ‘nsys’ source for V4 does not yet include the source for pipes, but the man page for 4th edition pipes has - more or less - the well known semantics, including the 4096 byte buffer capacity.

Does anyone remember:

- why the single fd approach was abandoned? To its credit, it appears to allow for limited 2-way communication. Maybe the reason was that it becomes harder to detect broken pipes?

- whether the V3 implementation was based on an in-memory approach and not the later 'anonymous backing file’? The 504 byte buffer capacity suggests a single buffer page minus some header info.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-04-25 17:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-25 11:14 [TUHS] v3 pipes Paul Ruizendaal
2020-04-25 17:54 ` Paul Winalski
  -- strict thread matches above, loose matches on Subject: below --
2020-04-24 12:54 Doug McIlroy
2020-04-23 13:48 [TUHS] V3 pipes Paul Ruizendaal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).