Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: Suggested method for returning a string from a C program? Date: Fri, 28 Mar 2025 16:53:18 -0700 Organization: None to speak of Lines: 36 Message-ID: <87ldsoww41.fsf@nosuchdomain.example.com> References: <20250326110011.634@kylheku.com> <86r02iicl3.fsf@linuxsc.com> <87pli0wztv.fsf@nosuchdomain.example.com> MIME-Version: 1.0 Content-Type: text/plain Injection-Date: Sat, 29 Mar 2025 00:53:23 +0100 (CET) Injection-Info: dont-email.me; posting-host="f0415a4398843ff1d018d36633e5e00b"; logging-data="4047271"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX188VD+IL/D+JF61qrNqKlFw" User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:/733eYyNJjz4QUvNjy6beyrrOdQ= sha1:eb80h99ZKHySHa1iFCfLBnjvhfU= Bytes: 3062 bart writes: > On 28/03/2025 22:33, Keith Thompson wrote: >> bart 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.com void Void(void) { Void(); } /* The recursive call of the void */