[Webkit-unassigned] [Bug 204398] New: [Win] Use thread_local to hold Ref<WTF::Thread> in the thread rather than using FLS
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Tue Nov 19 23:49:59 PST 2019
https://bugs.webkit.org/show_bug.cgi?id=204398
Bug ID: 204398
Summary: [Win] Use thread_local to hold Ref<WTF::Thread> in the
thread rather than using FLS
Product: WebKit
Version: WebKit Nightly Build
Hardware: Unspecified
OS: Unspecified
Status: NEW
Severity: Normal
Priority: P2
Component: Web Template Framework
Assignee: webkit-unassigned at lists.webkit.org
Reporter: Hironori.Fujii at sony.com
CC: ysuzuki at apple.com
[Win] Use thread_local to hold Ref<WTF::Thread> in the thread rather than using FLS
thread_local seems faster than FLS.
https://en.cppreference.com/w/cpp/keyword/thread_local
11:09 <yusukesuzuki> fujihiro: do you know the performance difference between FLS and `thread_local` in Windows?
11:12 <fujihiro> yusukesuzuki: I don't know.
11:12 <yusukesuzuki> fujihiro: it would be possible that `thread_local` is faster than FLS. If it is faster, it could be nice using thread_local for Thread for Windows (and maybe Linux?).
11:13 <yusukesuzuki> For Darwin, we are using `_pthread_getspecific_direct`, which is super fast (basically it is the same to TLS Local-Exec semantics IIRC).
11:15 <yusukesuzuki> IIRC, facebook folly is saying thread_local is faster than pthread_getspecific, and IIRC, FLS in Windows is very slow. It is possible that we could get perf improvement if we switch using thread_local for Windows's current Thread holder.
11:22 <fujihiro> yusukesuzuki: Sounds interesting. Will check.
11:28 <fujihiro> yusukesuzuki: Do you mean WTF::ThreadSpecific also should use `thread_local`? If so, how can I ensure destructing WTF::Thread after WTF::ThreadSpecific?
11:29 <yusukesuzuki> fujihiro: I mean, just using `thread_local` only for Thread's holder.
11:29 <yusukesuzuki> fujihiro: not considering about using `thread_local` for the other ThreadSpecific.
11:29 <yusukesuzuki> fujihiro: maybe, for Linux, we should use pthread_getspecific because of ordering thing (pthread works as we expect).
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20191120/3ce41477/attachment.htm>
More information about the webkit-unassigned
mailing list