On Wed, 9 Aug 2006, Lars Ellenberg wrote:

> / 2006-08-09 14:45:16 +0100
> \ David Lee:
> > So I think we're agreed on the principle of rewriting it.
> >
> > But since my earlier email a further thought has crossed my mind about the
> > merits of:
> >    thing1 >> fifo
> >    thing2 >> fifo
> >    thing3 >> fifo
> > vs:
> >    (thing1; thing2l thing3) >> fifo
> >
> > The first does three sets of open/close operations, the second does
> > only one.  Efficiency.
> >
> > Also each operation may have potential "end-of-data" or "flush" semantics
> > on the fifo, whereas the second does all these as a single set.
>
> right. see also my other mail.

Yes.  Thanks.  (Our emails crossed in the post!)

>
> > This is probably not sigificant.  But if it is (or if there is a future
> > chance of its becoming significant) then the second version (the single
> > parenthesised subshell into a single call to the fifo) may be preferable.
> >
> > I'll prepare a local-workspace patch for the:
> >    (thing1; thing2l thing3) >> fifo
> > variant and apply it post-2.0.7 shipment.
>
> the original version semantics would probably best be matched by using a
> second cat again, like this:
>     (echo ">>>"; cat -; echo "<<<") | cat - >> $HA_FIFO

Hmmm... I don't see any functional difference between my proposed:
   (echo ">>>"; cat -; echo "<<<") >> $HA_FIFO
and your proposed:
   (echo ">>>"; cat -; echo "<<<") | cat - >> $HA_FIFO

Under what conditions would they behave differently?  What benefit does
your more complex version have that mine lacks?

(I'm happy to learn!)

Best wishes.

-- 

:  David Lee                                I.T. Service          :
:  Senior Systems Programmer                Computer Centre       :
:                                           Durham University     :
:  http://www.dur.ac.uk/t.d.lee/            South Road            :
:                                           Durham DH1 3LE        :
:  Phone: +44 191 334 2752                  U.K.                  :
_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev@lists.linux-ha.org
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/

Reply via email to