Bug 65809

Summary: Move the shared LineBreakIteratorPool from ThreadGlobalData into its own ThreadSpecific
Product: WebKit Reporter: mitz
Component: TextAssignee: mitz
Status: RESOLVED FIXED    
Severity: Normal CC: ap
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Remove ThreadGlobalData::lineBreakIteratorPool() and implement LineBreakIteratorPool::shared() using ThreadSpecific
none
Remove ThreadGlobalData::lineBreakIteratorPool() and implement LineBreakIteratorPool::shared() using ThreadSpecific
none
Remove ThreadGlobalData::lineBreakIteratorPool() and implement LineBreakIteratorPool::shared() using ThreadSpecific sam: review+

Description mitz 2011-08-06 00:41:44 PDT
Move the shared LineBreakIteratorPool from ThreadGlobalData into its own ThreadSpecific
Comment 1 mitz 2011-08-06 00:42:34 PDT
<rdar://problem/9338442>
Comment 2 mitz 2011-08-06 00:54:21 PDT
Created attachment 103145 [details]
Remove ThreadGlobalData::lineBreakIteratorPool() and implement LineBreakIteratorPool::shared() using ThreadSpecific
Comment 3 Darin Adler 2011-08-06 07:45:56 PDT
Comment on attachment 103145 [details]
Remove ThreadGlobalData::lineBreakIteratorPool() and implement LineBreakIteratorPool::shared() using ThreadSpecific

View in context: https://bugs.webkit.org/attachment.cgi?id=103145&action=review

> Source/WebCore/platform/text/LineBreakIteratorPoolICU.h:92
> +    static WTF::ThreadSpecific<LineBreakIteratorPool>* staticPool;

Since this is used only in one function it could be a static local to the function rather than a static data member. If it was, the function would not need an explicit check for null and we also would have no need for LineBreakIteratorPoolICU.cpp.
Comment 4 mitz 2011-08-06 09:45:08 PDT
Created attachment 103149 [details]
Remove ThreadGlobalData::lineBreakIteratorPool() and implement LineBreakIteratorPool::shared() using ThreadSpecific
Comment 5 mitz 2011-08-06 09:49:59 PDT
Created attachment 103150 [details]
Remove ThreadGlobalData::lineBreakIteratorPool() and implement LineBreakIteratorPool::shared() using ThreadSpecific
Comment 6 mitz 2011-08-06 10:01:15 PDT
Fixed in <http://trac.webkit.org/r92553>.
Comment 7 Alexey Proskuryakov 2011-08-06 17:34:48 PDT
I know what's bad about this approach (frameworks shouldn't waste thread specific keys). What's good about it?
Comment 8 mitz 2011-08-06 19:39:50 PDT
(In reply to comment #7)
> I know what's bad about this approach (frameworks shouldn't waste thread specific keys). What's good about it?

Making the LineBreakIteratorPool actually thread-specific even in ports that don’t enable HTML5 Worker Threads. In that configuration, ThreadGlobalData is shared between all threads in the process; however, LineBreakIteratorPools still need to be per-thread.