Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!wuarchive!uunet!mcsun!hp4nl!ruuinf!henkp From: henkp@ruuinf.cs.ruu.nl (Henk P. Penning) Newsgroups: comp.lang.perl Subject: Re: pipe to sort and back Message-ID: <3710@ruuinf.cs.ruu.nl> Date: 29 Aug 90 00:00:35 GMT References: <1990Aug24.145831.13299@DRD.Com> <3702@ruuinf.cs.ruu.nl> <3284@uniol.UUCP> Organization: Utrecht University, Dept. of CS Lines: 25 In article <3284@uniol.UUCP> henseler@uniol.UUCP (Herwig Henseler) writes: > [ quotes original problem, my solution, and detects deadlock ] >To really write and read independently you have to fork to split the process, >and it will look like: > [ fork ; child writes ; parent reads ] This could also be achieved by prepending the program-to-exec with a buffering process like "perl -e '@_ = <> ; print @_' |". The problem is that this solution is inadequate in the situation where the data that the main-prog sends to the sub-prog depends (also) on what the sub-prog sends back. I think there is no general solution to the deadlock problem. To avoid it, you always have to be carefull with your buffering and flushing. === HenkP === -- Henk P. Penning, Dept of Computer Science, Utrecht University. Padualaan 14, P.O. Box 80.089, 3508 TB Utrecht, The Netherlands. Telephone: +31-30-534106 e-mail : henkp@cs.ruu.nl (uucp to hp4nl!ruuinf!henkp)