[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-glpk] Thread safety of GLPK
From: |
David Monniaux |
Subject: |
Re: [Help-glpk] Thread safety of GLPK |
Date: |
Tue, 27 Dec 2016 09:14:17 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux i686; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 |
I stumbled on the same problem as Mathieu: I wanted to run independent
GLPK computations (separate problem objects) in different threads (these
threads are started from OpenMP).
My solution was to modify one line in tls.c:
static _Thread_local void *tls = NULL;
This is standard C2011 and supported by recent compilers.
It seems older versions of gcc used __thread and Visual C++ supported
__declspec(thread), both of which are still respectively supported.
I was wondering whether some configure option could make its way into
glpk so as to activate thread-local storage for the main platforms,
since this seems a common request.
--
David Monniaux
Directeur de recherche au CNRS, laboratoire VERIMAG
http://www-verimag.imag.fr/~monniaux/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [Help-glpk] Thread safety of GLPK,
David Monniaux <=