From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: <20091207141304.GA28905@nipl.net> References: <20091205031747.GA8759@nipl.net> <20091205194741.0697D5B76@mail.bitblocks.com> <20091207141304.GA28905@nipl.net> Date: Mon, 7 Dec 2009 14:36:36 +0000 Message-ID: From: roger peppe To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [9fans] ideas for helpful system io functions Topicbox-Message-UUID: aa07e5e4-ead5-11e9-9d60-3106f5b1d025 2009/12/7 Sam Watkins : > I meant for example if a process is reading from its stdin a open file 'A= ' and > writing to stdout the input of a pipe 'B', rather than looping and forwar= ding > data it may simply "join" these two fds, and exit. =C2=A0The OS will then= do what is > necessary to make sure the data can travel from A to B (and/or vice versa= ) with > the minimum effort needed. i'm not sure how you think this would work. a file descriptor is essentially a passive object - it responds to read, write, etc requests on it, but it doesn't do anything of its own accord. if i do: fd1 :=3D open("/foo1", ORDWR); fd2 :=3D open("/foo2", ORDWR); fd3 :=3D fdjoin(fd1, fd2); what is going to happen? something has got to initiate the requests to actually shift the data, and it's not clear which direction the data will flow. this is an optimisation, right? what parts of the current system could be speeded up by the use of this primitive?