diff options
author | Vlad Brezae <brezaevlad@gmail.com> | 2016-11-11 01:24:51 +0300 |
---|---|---|
committer | Vlad Brezae <brezaevlad@gmail.com> | 2016-12-14 18:52:49 +0300 |
commit | 7f76306f79a62af3b6466c43558ff2de448d815c (patch) | |
tree | 0901c5cb7a9d87ffb3b156064aa863d692bd7e04 /libgc | |
parent | 0b8670e8fbbb1d03cc0b879f288f45cb25572a93 (diff) |
[runtime] Refactor and unify tls access
The purpose of this commit is to unify tls access across all platforms. We had tls information spread out throughout the entire code which was guarded with many defines/capabilities which made very hard to follow what was going on. Also this made switching between pthread and __thread very unstable since there were a lot of dependencies between different pieces of the tls infrastructure. Also it was not very clear what happens if one of the tls pieces failed.
Now we are moving all the tls variables to a single module that provides getters/setters and initialization API. Runtime code now knows that we can always access a tls variable (from managed code, we just do a nowrapper icall into the same global geters/setters). Even though we used to these type of calls all around before, it is worth mentioning that runtime should account for a thread to be in this type of unregistered code without m2n wrapper and no register jinfo.
On average this makes common tls intensive methods (m2n wrappers and managed allocator) 20% slower, with potential for more regression if we use tls getters/setters recklessly. As a consequence we will re-enable the most important pieces of fast tls code in the future.
Diffstat (limited to 'libgc')
-rw-r--r-- | libgc/pthread_support.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libgc/pthread_support.c b/libgc/pthread_support.c index 623a94e7c8c..cdca3325275 100644 --- a/libgc/pthread_support.c +++ b/libgc/pthread_support.c @@ -205,7 +205,7 @@ static GC_key_t GC_thread_key; #ifdef USE_COMPILER_TLS -__thread MONO_TLS_FAST void* GC_thread_tls; +__thread void* GC_thread_tls; /* * gcc errors out with /tmp/ccdPMFuq.s:2994: Error: symbol `.LTLS4' is already defined |