[packages/tbb] up to 2021.9.0

atler atler at pld-linux.org
Sat Apr 22 14:20:31 CEST 2023


commit 50de33e54ee1c1608b6172ceb638f46349a57bdb
Author: Jan Palus <atler at pld-linux.org>
Date:   Sat Apr 22 14:18:53 2023 +0200

    up to 2021.9.0
    
    - pthread_create retry on eagain patch applied upstream

 retry-pthread-create-eagain.patch | 63 ---------------------------------------
 tbb.spec                          |  6 ++--
 2 files changed, 2 insertions(+), 67 deletions(-)
---
diff --git a/tbb.spec b/tbb.spec
index 4173501..e2fdcff 100644
--- a/tbb.spec
+++ b/tbb.spec
@@ -10,13 +10,13 @@
 Summary:	The Threading Building Blocks library abstracts low-level threading details
 Summary(pl.UTF-8):	Threading Building Blocks - biblioteka abstrahująca niskopoziomowe szczegóły obsługi wątków
 Name:		tbb
-Version:	2021.8.0
+Version:	2021.9.0
 Release:	1
 License:	Apache v2.0
 Group:		Development/Tools
 # Source0Download: https://github.com/oneapi-src/oneTBB/releases
 Source0:	https://github.com/01org/tbb/archive/v%{version}/oneTBB-%{version}.tar.gz
-# Source0-md5:	392421c6f33ebd00edb57eba36054da9
+# Source0-md5:	ba4ecedc4949f673a34b35de738a72fc
 Source1:	http://www.threadingbuildingblocks.org/uploads/81/91/Latest%20Open%20Source%20Documentation/Design_Patterns.pdf
 # Source1-md5:	46062fef922d39abfd464bc06e02cdd8
 Source2:	http://www.threadingbuildingblocks.org/uploads/81/91/Latest%20Open%20Source%20Documentation/Getting_Started.pdf
@@ -26,7 +26,6 @@ Source3:	http://www.threadingbuildingblocks.org/uploads/81/91/Latest%20Open%20So
 Source4:	http://www.threadingbuildingblocks.org/uploads/81/91/Latest%20Open%20Source%20Documentation/Tutorial.pdf
 # Source4-md5:	5bbdd1050c5dac5c1b782a6a98db0c46
 URL:		http://www.threadingbuildingblocks.org/
-Patch0:		retry-pthread-create-eagain.patch
 BuildRequires:	cmake >= 3.1
 BuildRequires:	hwloc-devel
 %{?with_libatomic:BuildRequires:	libatomic-devel}
@@ -98,7 +97,6 @@ Building Blocks (TBB).
 
 %prep
 %setup -q -n oneTBB-%{version}
-%patch0 -p1
 
 cp -p %{SOURCE1} %{SOURCE2} %{SOURCE3} %{SOURCE4} .
 
diff --git a/retry-pthread-create-eagain.patch b/retry-pthread-create-eagain.patch
deleted file mode 100644
index 7188839..0000000
--- a/retry-pthread-create-eagain.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-From f12c93efd04991bc982a27e2fa6142538c33ca82 Mon Sep 17 00:00:00 2001
-From: Rui Ueyama <ruiu at cs.stanford.edu>
-Date: Sat, 7 May 2022 19:55:24 +0800
-Subject: [PATCH] Retry if pthread_create fails with EAGAIN
-
-On many Unix-like systems, pthread_create can fail spuriously even if
-the running machine has enough resources to spawn a new thread.
-Therefore, if EAGAIN is returned from pthread_create, we actually have
-to try again.
-
-I observed this issue when running the mold linker
-(https://github.com/rui314/mold) under a heavy load. mold uses OneTBB
-for parallelization.
-
-As another data point, Go has the same logic to retry on EAGAIN:
-https://go-review.googlesource.com/c/go/+/33894/
-
-nanosleep is defined in POSIX 2001, so I believe that all Unix-like
-systems support it.
-
-Signed-off-by: Rui Ueyama <ruiu at cs.stanford.edu>
----
- src/tbb/rml_thread_monitor.h | 19 ++++++++++++++++++-
- 1 file changed, 18 insertions(+), 1 deletion(-)
-
-diff --git a/src/tbb/rml_thread_monitor.h b/src/tbb/rml_thread_monitor.h
-index 13b556380..5b844b232 100644
---- a/src/tbb/rml_thread_monitor.h
-+++ b/src/tbb/rml_thread_monitor.h
-@@ -31,6 +31,7 @@
- #include <pthread.h>
- #include <cstring>
- #include <cstdlib>
-+#include <time.h>
- #else
- #error Unsupported platform
- #endif
-@@ -191,8 +192,24 @@ inline thread_monitor::handle_type thread_monitor::launch( void* (*thread_routin
-     check(pthread_attr_init( &s ), "pthread_attr_init has failed");
-     if( stack_size>0 )
-         check(pthread_attr_setstacksize( &s, stack_size ), "pthread_attr_setstack_size has failed" );
-+
-     pthread_t handle;
--    check( pthread_create( &handle, &s, thread_routine, arg ), "pthread_create has failed" );
-+    int tries = 0;
-+    for (;;) {
-+      int error_code = pthread_create(&handle, &s, thread_routine, arg);
-+      if (!error_code)
-+        break;
-+      if (error_code != EAGAIN || tries++ > 20) {
-+        handle_perror(error_code, "pthread_create has failed");
-+        break;
-+      }
-+
-+      // pthreaed_create can spuriously fail on many Unix-like systems.
-+      // Retry after tries * 1 millisecond.
-+      struct timespec ts = {0, tries * 1000 * 1000};
-+      nanosleep(&ts, NULL);
-+    }
-+
-     check( pthread_attr_destroy( &s ), "pthread_attr_destroy has failed" );
-     return handle;
- }
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/tbb.git/commitdiff/50de33e54ee1c1608b6172ceb638f46349a57bdb



More information about the pld-cvs-commit mailing list