[Webkit-unassigned] [Bug 233488] make font code usable from multiple threads

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Nov 25 01:22:34 PST 2021


https://bugs.webkit.org/show_bug.cgi?id=233488

--- Comment #1 from Chris Lord <clord at igalia.com> ---
(In reply to Cameron McCormack (:heycam) from comment #0)
> OffscreenCanvas needs the ability to call into font code from worker
> threads.  Bug 219283 was filed to make FontCache and FontCascadeCache
> thread-safe, but I'm planning to take the approach of giving each worker
> thread (that needs it) its own FontCache object.  Rather than sharing font
> objects between threads, each thread will create and use completely
> independent font objects.  This will mean having all font-related caches
> exist for each thread, and I plan to handle that by hanging them off
> FontCache.  There are also a bunch of static variables with initializers in
> font code, which in the presence of -fno-threadsafe-statics, either need to
> be non-static, have locking around them, or be made thread-specific by being
> moved onto FontCache.
> 
> I have a bunch of small patches to address the issues I've found so far,
> which I'll file blocking this bug.

This already happens? As far as I can tell, you're describing how it currently works - There's no thread-safe FontCache singleton, each worker creates their own FontCache. As far as I know, static variables are only accessed on the main thread, and if they aren't, that's a bug that needs addressing.

-- 
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/20211125/80ff7010/attachment-0001.htm>


More information about the webkit-unassigned mailing list