[webkit-dev] Feature Announcement: Moving HTML Parser off the Main Thread

Benjamin Poulain benjamin at webkit.org
Wed Jan 9 19:35:08 PST 2013


On Wed, Jan 9, 2013 at 7:07 PM, Eric Seidel <eric at webkit.org> wrote:

> On Wed, Jan 9, 2013 at 6:38 PM, Oliver Hunt <oliver at apple.com> wrote:
> > How will we ensure thread safety?  Even at just the tokenizing level
> don't we use AtomicString?  AtromicString isn't threadsafe wrt StringImpl
> IIRC so this seems like it sould add a world of hurt.
>
> AtomicString is already usable from other threads
> (http://trac.webkit.org/changeset/38094), but are correct this is the
> core concern!  PickledToken (or whatever it's called) will have to be
> written very carefully in order to minimize/eliminate copies, while
> still guaranteeing thread safety.  The correct design and handling of
> PickledToken is the entire question of this whole endeavor.
>

That is probably what you meant, but just in case...

AtomicString can be used from different threads, but is not thread safe.
You must make an isolatedCopy() for message passing if you keep a reference
to the String in your thread.
Not the end of the world, but something to be aware of :)

Cheers,
Benjamin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20130109/36dd493b/attachment.html>


More information about the webkit-dev mailing list