Ok, then here it is a new patch (tested and bootstrapped on linux).

On linux with --disable-tls now all libgomp make check tests pass; for
Android I've patched toolchain and tried test from one of the
mentioned bugs, test passes too.

Is there some benchmark to check performance?


2014-10-01  Varvara Rainchik  <varvara.rainc...@intel.com>

        * libgomp.h (HAVE_TLS): Set to 1.

--
--- a/libgomp/libgomp.h
+++ b/libgomp/libgomp.h
@@ -45,6 +45,8 @@
 # pragma GCC visibility push(hidden)
 #endif

+#define HAVE_TLS 1
+
 /* If we were a C++ library, we'd get this from <std/atomic>.  */
 enum memmodel
 {

2014-09-30 18:40 GMT+04:00 Richard Henderson <r...@redhat.com>:
> On 09/30/2014 02:52 AM, Jakub Jelinek wrote:
>> On Tue, Sep 30, 2014 at 11:03:47AM +0400, Varvara Rainchik wrote:
>>> Corrected patch: call pthread_setspecific (gomp_tls_key, NULL) in
>>> gomp_thread_start if HAVE_TLS is not defined.
>>>
>>> 2014-09-19  Varvara Rainchik  <varvara.rainc...@intel.com>
>>>
>>>         * libgomp.h (gomp_thread): For non TLS case create thread data.
>>>         * team.c (non_tls_thread_data_destructor,
>>> create_non_tls_thread_data): New functions.
>>
>> I actually wonder when we have emutls support in libgcc if it wouldn't
>> be better to just define HAVE_TLS always to 1 (i.e. remove all the
>> conditionals on it), then you wouldn't need to bother with this at all.
>>
>> I don't have an OS which doesn't support native TLS though, so somebody with
>> such a system would need to test it and benchmark if it doesn't make things
>> slower.
>>
>> Richard, thoughts on this?
>
> I like that idea better as well.
>
>
> r~
>

Reply via email to