Sujet : Re: Suggested method for returning a string from a C program?
De : Keith.S.Thompson+u (at) *nospam* gmail.com (Keith Thompson)
Groupes : comp.lang.cDate : 29. Mar 2025, 00:53:18
Autres entêtes
Organisation : None to speak of
Message-ID : <87ldsoww41.fsf@nosuchdomain.example.com>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
User-Agent : Gnus/5.13 (Gnus v5.13)
bart <
bc@freeuk.com> writes:
On 28/03/2025 22:33, Keith Thompson wrote:
bart <bc@freeuk.com> writes:
On 28/03/2025 20:41, Scott Lurndal wrote:
[...]
The gnu compiler is not multithreaded. The single thread was
compute bound for 13 minutes and 46 seconds.
>
So what was that -j96 about?
"-j96" is an option to GNU make, not to the compiler. It might
invoke
gcc multiple times in parallel, but each invocation of gcc will still be
single-threaded.
>
So, is there just once instance of gcc at work during those 13
minutes, or multiple?
>
In other words, would it take longer than 13:40 mins without it, or
does it help? If -j96 makes no difference, then why specify it?
I haven't done any measurements, but I don't know what's unclear.
If a single thread was compute bound for 13:46, using "-j96"
won't make that single thread run any faster, but it can enable
"make" to do other things while that single thread is running.
It's also common to use "-j" without an argument, to run as many
jobs simultaneously as possible, or "-j$(nproc)" to run as many
parallel jobs as the number of processing units available (if you
have the "nproc" command; it's part of GNU coreutils).
I can imagine "-j" causing problems if dependencies are expressed
incorrectly, but I haven't run into such a problem myself.
-- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.comvoid Void(void) { Void(); } /* The recursive call of the void */