public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
To: gentoo-dev@lists.gentoo.org
Subject: Re: [gentoo-dev] has_version etc parallelisability
Date: Sat, 5 Jan 2008 04:52:12 +0000	[thread overview]
Message-ID: <20080105045212.7eebb1dd@snowcone> (raw)
In-Reply-To: <20080105025056.GE5844@seldon>

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

On Fri, 4 Jan 2008 18:50:56 -0800
Brian Harring <ferringb@gmail.com> wrote:
> Depends on the implementation; for pkgcore, if that comm pipe is 
> dead, the ebuild env *should* be dead, or dieing.  Background'ing 
> processes from that env isn't valid imo, either.

Right. Paludis will give a weird die message but not actually fail if
you do:

src_compile() {
    { sleep 10 ; has_version '>=app-misc/foo-1.23' ; } &
}

> If you're refering to an ebuild that parallelizes itself while 
> executing, iow, parallelization w/in the ebuild env/phase execution, 
> I'd look more at being able to batch commands instead of trying to
> run them in parallel.

That's its own slippery slope. Because of limited size pipes, the
following causes allllll sorts of trouble:

pkg_setup()
{                                                                   
    portageq match ${ROOT} cat/some-pkg | while read a ; do
        if has_version ="${a}" ; then
            echo "yes to ${a}"
        else
            echo "no to ${a}"
        fi
    done                                                                        
}

The problem is thus: the has_version and portageq match here can be run
in parallel by bash. The portageq match output can be longer than the
maximum size of a pipe. Thus, if the above is legal, no lock that is
visible to the has_version can be held by portageq match once it starts
producing output.

-- 
Ciaran McCreesh

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2008-01-05  4:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-30 22:35 [gentoo-dev] has_version etc parallelisability Ciaran McCreesh
2007-12-31  3:03 ` Petteri Räty
2007-12-31 14:25   ` Ciaran McCreesh
2007-12-31  4:11 ` Alec Warner
2007-12-31 14:28   ` Ciaran McCreesh
2008-01-05  2:50     ` Brian Harring
2008-01-05  4:52       ` Ciaran McCreesh [this message]
2008-01-05 17:29         ` Luca Barbato
2008-01-05 18:55           ` Petteri Räty
2008-01-06  0:31           ` Ciaran McCreesh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080105045212.7eebb1dd@snowcone \
    --to=ciaran.mccreesh@blueyonder.co.uk \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox