Path: csiph.com!goblin2!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail From: Earnestly Newsgroups: gnu.bash.bug Subject: Re: How does this wait -n work to cap parallelism? Date: Mon, 29 Jul 2019 20:02:33 +0100 Lines: 12 Approved: bug-bash@gnu.org Message-ID: References: <20190729181242.GB2032@teapot> <20190729183848.GE1218@eeg.ccf.org> <20190729190233.GC2032@teapot> NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: usenet.stanford.edu 1564426959 25747 209.51.188.17 (29 Jul 2019 19:02:39 GMT) X-Complaints-To: action@cs.stanford.edu To: bug-bash@gnu.org Envelope-to: bug-bash@gnu.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=date:from:to:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to:user-agent; bh=hxKkrKMwr6WeIpiaU1JGW8Q7bjE3Re5dyl2QNXg/DuQ=; b=ckoSHePKwCczY/z+PuOAOXtCtnWlHm/r7xwIyXG3uGFKmyJxPFTxw3WEUdlx2AGlvF rhx92PV7XJkWHJVa/OIiIevsmJWDGVRzOFAQl/Y6P6IqiGw6/QgCgFK68EJIt46O/if4 JBQXjsX6k2BBcoC396JqqEG9xwV6BJ881Q9Yzg949qA507qSjgskGTh58XzRAScwqtjN oIw3yH/x/fYKp9/Tx+yif65vJ7OWsZRL6gnTaLQUUP9mzE7yKQSsT5qtCNrSw5WsuarS o97YMackb4B/C5clhBx3/CyTPB85nDJP2T1tWV0msXJsDnoyLR7l1TggbZD77ErUO8L4 Y0Ww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=hxKkrKMwr6WeIpiaU1JGW8Q7bjE3Re5dyl2QNXg/DuQ=; b=PM+jZMnTehp4G73QbdcVsC1eC0NmYnW9OCHTLmZIhGT3pNHxgyknPZlkh3iX90PnZk qGSsmAeP2EGCqluLWOyDojsOTLvpIprzyyWLP8Bakrfu5VIgo5xGBi5cYpMVLrrPHKvt JoSwrFKwk4rsEO6qOAkK4c9tNAMWwodSlkGjfcGMKrKkHZAkHRvxdYO5ifyYDgzh5KjW RJ1m87vIPPvQynd6+6nuIA96pqgcj/hB4Ax8tLRpkqqRRaj7Bi4gnMuLAaeTgQWqf19A +qQnvMBQOd1RhtqURITahmTD247nXKlmkclKZ0x/epDHtcUVijCIROAYgDcgM9T5MVzI Cndw== X-Gm-Message-State: APjAAAVFuSWqMVJJ/NsfTed06YnJK6ZTruObgQSUz3wwgQf8rNJP029y Iy2uGTsWZAyxb5sx/PoA2g== X-Google-Smtp-Source: APXvYqwcACTKSCgVZkLxuiT4jkjlZmse3HnETSl9z+Eb+Ox/vfZfELL0DvZUpJ/cRG2GA8n/em8XQQ== X-Received: by 2002:a1c:b68a:: with SMTP id g132mr104594545wmf.66.1564426954286; Mon, 29 Jul 2019 12:02:34 -0700 (PDT) Mail-Followup-To: Earnestly , bug-bash@gnu.org Content-Disposition: inline In-Reply-To: <20190729183848.GE1218@eeg.ccf.org> User-Agent: Mutt/1.12.1 (2019-06-15) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32b X-BeenThere: bug-bash@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Bug reports for the GNU Bourne Again SHell List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: <20190729190233.GC2032@teapot> X-Mailman-Original-References: <20190729181242.GB2032@teapot> <20190729183848.GE1218@eeg.ccf.org> Xref: csiph.com gnu.bash.bug:15268 On Mon, Jul 29, 2019 at 02:38:48PM -0400, Greg Wooledge wrote: > The same happens for my_job 7, and my_job 8. Each one is preceded by > a wait -n, so it waits for one of the existing jobs to terminate before > the new job is launched. This aspect of the behaviour isn't in question. Without reiterating too much, the question is about how that cap is maintained after the 'wait -n' loop only ever experiences a single agent while 'i' is incrementing, and only after 'i' has exceeded 'nproc' does the parallelism start.