public inbox for cygwin-apps@cygwin.com
 help / color / mirror / Atom feed
From: Achim Gratz <Stromeko@nexgo.de>
To: cygwin-apps@cygwin.com
Subject: Re: [PATCH cygport] lib/src_postinst.cygpart: parallelize __prepstrip
Date: Thu, 30 Mar 2023 21:49:27 +0200	[thread overview]
Message-ID: <878rfec94o.fsf@Rainer.invalid> (raw)
In-Reply-To: <822a414c-be34-319e-c8d9-810cf7383e7e@dronecode.org.uk> (Jon Turney via Cygwin-apps's message of "Mon, 27 Mar 2023 19:43:50 +0100")

Jon Turney via Cygwin-apps writes:
> On 26/03/2023 19:12, Jon Turney via Cygwin-apps wrote:
>>> -        usr/lib/gcc/*/lib*|usr/lib/gcc/*/*.o)
>>> +        usr/lib/gcc/*/*.o)
>> Why this change?

It looks like a mistake that I didn't catch.

>> 
>>> +    local nproc=$(nproc)
>> This limit should probably be taken from the --jobs command line
>> parameter, if specified

Yes, although one could argue that it should actually oversubscribe
since the CPU load per process is expected to be significantly less than
100% per process.

> Looking at this a bit more, a couple of perhaps more serious problems:
>
> * The parallel invocations of __prepstrip_one are all appending to
>   ${T}/.dbgsrc.out
>
> I don't see what makes that safe against interleaving of the output.

Line-buffering and the line being shorter than the buffer should.

> It's probably possible to have each instance write to a separate file
> and collect them together in __prepdebugsrc

Nah, if you insist on making it _really_ safe regardless of line lenght
and buffer size vagaries I'll do file locking on the output file.

> * This patch causes several failures in the testsuite, e.g. with
>   autotools/c testcase.

Which?

> On a brief attempt at debugging, it this looks like it's due to not
> waiting for all the __prepstrip_one to complete before moving on, but
> I think the final wait should prevent that, so idk.

I've seen an indication that the final wait doesn't work, but that is
fixable by a sleep apparently.  Did You see that the process number
limiting doesn't work?

> I'm not clear that invoking 'jobs', is actually doing anything, if
> job-control is turned off in a non-interactive shell?

No, "jobs" shouldn't do anything, but wait should still work I think
(the manpage talks about jobs, but it really means "children").  But
then again, a bit of googling tells me that the bashism "wait -n"
actually needs job control to be enabled, natch.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

SD adaptations for Waldorf Q V3.00R3 and Q+ V3.54R2:
http://Synth.Stromeko.net/Downloads.html#WaldorfSDada

  reply	other threads:[~2023-03-30 19:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-26 18:12 Jon Turney
2023-03-27 18:43 ` Jon Turney
2023-03-30 19:49   ` Achim Gratz [this message]
2023-03-30 20:34     ` Jon Turney
2023-04-02 17:39       ` Jon Turney
2023-04-02 19:28         ` Achim Gratz

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=878rfec94o.fsf@Rainer.invalid \
    --to=stromeko@nexgo.de \
    --cc=cygwin-apps@cygwin.com \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).