[Rpm-maint] [rpm-software-management/rpm] Enable thread autodetection for a parallel compression. (#1324)

Panu Matilainen notifications at github.com
Wed Aug 19 06:44:47 UTC 2020


@pmatilai commented on this pull request.



> @@ -523,6 +523,28 @@ fprintf(stderr, "*** ufdOpen(%s,0x%x,0%o)\n", url, (unsigned)flags, (unsigned)mo
     return fd;
 }
 
+/* Return number of threads ought to be used for compression based
+   on a parsed value threads (e.g. from w7T0.xzdio or w7T16.xzdio).
+   Value -1 means automatic detection. */
+
+static int
+get_compression_threads (int threads)
+{
+    if (threads == -1)
+	threads = rpmExpandNumeric("%{getncpus}");
+
+#if __WORDSIZE == 32
+    /* Limit thread up to 4 for 32-bit systems.  */
+    if (threads > 4)
+    {

{ belongs on the if-line in rpm coding style. The "thread" in the comment should probably be in plural.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1324#pullrequestreview-470166476
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20200818/9f234781/attachment.html>


More information about the Rpm-maint mailing list