Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: zmedico@g.o, Brian Harring <ferringb@×××××.com>
Subject: Re: [gentoo-dev] multiprocessing.eclass: doing parallel work in bash
Date: Sun, 03 Jun 2012 07:15:20
Message-Id: 20120603091522.4c0ee5a6@pomiocik.lan
In Reply to: Re: [gentoo-dev] multiprocessing.eclass: doing parallel work in bash by Zac Medico
On Sat, 02 Jun 2012 18:04:41 -0700
Zac Medico <zmedico@g.o> wrote:

> #!/usr/bin/env bash > named_pipe=$(mktemp -d)/fifo > > ( > # hold the pipe open in read mode, so > # the writer doesn't block > sleep 3 > ) < "$named_pipe" &
I don't understand this part. This keeps the pipe open for reading which obviously causes it to lose data. If you open it, you need to read all that is there and then close. And writers are supposed to be blocked. They are forked and just write when done, so there's no problem with keeping them alive for a short while. -- Best regards, Michał Górny

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies