[Webkit-unassigned] [Bug 86483] LayerAnimation is not thread safe, which makes dereferencing an expensive operation

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed May 16 11:29:48 PDT 2012


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





--- Comment #5 from Arvid Nilsson <anilsson at rim.com>  2012-05-16 11:28:52 PST ---
(In reply to comment #3)
> It is surprising that making refcounting alone thread safe is sufficient to make using the objects from multiple threads safe.

Hi Alexey! Thanks for having a look!

I knew from the start this was going to be a tough sell because switching to ThreadSafeRefCounted brings a small performance penalty compared to regular old RefCounted, and no other WebKit port uses these classes the way the BlackBerry port does.

We're not in this to make the classes thread safe, instead what we do is treat these as immutable as soon as they enter our accelerated compositing backend. No TransformOperation or TimingFunction data is changed after they're handed off to the BlackBerry accelerated animation implementation (which is pretty much a copy/paste job of the WebKit animation implementation, only running on another thread).

However, even if we don't touch any data of these objects, the refcount will still be mutated as we pass these objects around and from one thread to the other.

We put this patch up so it can be the subject of early discussion, then perhaps we can discuss if other ports are interested in moving in the direction of making the WebKit animation implementation usable from a secondary thread instead of just the WebKit thread. The Chromium CCLayer thread seems to be moving in this direction, but I'm not sure if they're developing an animation framework from scratch instead of reusing the interpolation implementation in WebKit.

For Apple's WebKit port, you have Core Animation, so you already have an animation framework and I guess there's no point for you to make the WebKit animation implementation usable from a secondary thread. Instead you copy over all Keyframe and Timing function information to Core Animation data structure, et voilĂ , no threading problem.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list