Deutsch   English   Français   Italiano  
<vs7f33$3u1sk$1@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail
From: bart <bc@freeuk.com>
Newsgroups: comp.lang.c
Subject: Re: Suggested method for returning a string from a C program?
Date: Sat, 29 Mar 2025 00:32:35 +0000
Organization: A noiseless patient Spider
Lines: 41
Message-ID: <vs7f33$3u1sk$1@dont-email.me>
References: <vrd77d$3nvtf$2@dont-email.me> <vrs7oi$1e2j7$1@dont-email.me>
 <vrtq62$2unrb$1@dont-email.me> <vru2t0$35frt$2@dont-email.me>
 <vrufju$3i02s$1@dont-email.me> <vrugmo$3ij4s$2@dont-email.me>
 <vrugut$3j3ah$1@dont-email.me> <vruma5$3mvbj$2@dont-email.me>
 <vs0gsh$1en04$1@dont-email.me> <20250326110011.634@kylheku.com>
 <vs25oi$2pqb$1@paganini.bofh.team> <QadFP.1351322$zz8b.870017@fx09.iad>
 <86r02iicl3.fsf@linuxsc.com> <JUzFP.529511$f81.413611@fx48.iad>
 <vs6jeh$31p79$3@dont-email.me> <dQDFP.256596$D_V4.171478@fx39.iad>
 <vs7788$3ml6o$1@dont-email.me> <87pli0wztv.fsf@nosuchdomain.example.com>
 <vs78vb$3o6s2$1@dont-email.me> <87ldsoww41.fsf@nosuchdomain.example.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 29 Mar 2025 01:32:35 +0100 (CET)
Injection-Info: dont-email.me; posting-host="0456d283b45811694d58326c90c160a7";
	logging-data="4130708"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX19+etrIP/8RuFAIexdq9Qo9"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:nHw2s1PN2+NI70XzdlnULR2FIZc=
Content-Language: en-GB
In-Reply-To: <87ldsoww41.fsf@nosuchdomain.example.com>
Bytes: 3453

On 28/03/2025 23:53, Keith Thompson wrote:
> 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.
> 

Are you saying that this job consists of single a C (or C++) source 
file, so it is not possible to parallelise the processes necessary to 
compile it? (I've not idea of gcc's capabilities there.)

That would be funny given that I've had criticisms myself for attempting 
to compile monolithic C programs.