From 046e4013cbfe6d4006bee81bcfab33ea01ecdebc Mon Sep 17 00:00:00 2001 From: Olivier Grisel Date: Wed, 19 Feb 2014 18:32:54 +0100 Subject: [PATCH] Revert "Refs #294. Used pthread_atfork to avoid hang after a Unix fork." This reverts commit 3617c22a5679c52b1e760d739d76a7bde9e84d35. --- driver/others/blas_server.c | 14 -------------- driver/others/blas_server_omp.c | 5 ----- driver/others/blas_server_win32.c | 5 ----- driver/others/memory.c | 6 +----- 4 files changed, 1 insertion(+), 29 deletions(-) diff --git a/driver/others/blas_server.c b/driver/others/blas_server.c index cc1015b..2afcb74 100644 --- a/driver/others/blas_server.c +++ b/driver/others/blas_server.c @@ -83,8 +83,6 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define ATTRIBUTE_SIZE 128 -extern void openblas_warning(int verbose, const char * msg); - /* This is a thread server model implementation. The threads are */ /* spawned at first access to blas library, and still remains until */ /* destruction routine is called. The number of threads are */ @@ -923,17 +921,5 @@ int BLASFUNC(blas_thread_shutdown)(void){ return 0; } -/* -https://github.com/xianyi/OpenBLAS/issues/294 -Use pthread_atfork to close blas_thread_server before fork. -Then, re-init blas_thread_server after fork at child and parent. -*/ -void openblas_fork_handler() -{ - int err; - err = pthread_atfork (BLASFUNC(blas_thread_shutdown), blas_thread_init, blas_thread_init); - if(err != 0) - openblas_warning(0, "OpenBLAS cannot install fork handler. You may meet hang after fork.\n"); -} #endif diff --git a/driver/others/blas_server_omp.c b/driver/others/blas_server_omp.c index 090590e..0a484f3 100644 --- a/driver/others/blas_server_omp.c +++ b/driver/others/blas_server_omp.c @@ -315,9 +315,4 @@ int exec_blas(BLASLONG num, blas_queue_t *queue){ return 0; } -void openblas_fork_handler() -{ - -} - #endif diff --git a/driver/others/blas_server_win32.c b/driver/others/blas_server_win32.c index 68630a6..100ca34 100644 --- a/driver/others/blas_server_win32.c +++ b/driver/others/blas_server_win32.c @@ -498,8 +498,3 @@ void openblas_set_num_threads(int num) { goto_set_num_threads(num); } - -void openblas_fork_handler() -{ - -} diff --git a/driver/others/memory.c b/driver/others/memory.c index 4faf82f..35758d1 100644 --- a/driver/others/memory.c +++ b/driver/others/memory.c @@ -1288,11 +1288,7 @@ void CONSTRUCTOR gotoblas_init(void) { #ifdef SMP if (blas_cpu_number == 0) blas_get_cpu_number(); #ifdef SMP_SERVER - if (blas_server_avail == 0) { - blas_thread_init(); - //deal with pthread and fork. - openblas_fork_handler(); - } + if (blas_server_avail == 0) blas_thread_init(); #endif #endif -- 2.7.4