[webkit-dev] ThreadIdentifier abstraction is inefficient

Dmitry Titov dimich at chromium.org
Thu Oct 29 15:30:42 PDT 2009


On Thu, Oct 29, 2009 at 3:10 PM, Anton Muhin <antonm at chromium.org> wrote:

> ens,
>
> Somewhat aside from ThreadIdentifier.
>
> Actually, at least for now, there should be no invocations of
> WTF::currentThread() at least for the renderer---everything should run
> in the same thread.


That sounds right. Same for Chromium Worker processes. Some time ago we
tried to run workers in the same process as renderer, or several workers in
the Worker process using v8 locking. It didn't work well so we abandoned the
idea. Seems like some good cleanup could help, nothing is as fast as not
running the code! :-)

As for previous attempt to fix the issue, there were 2 main concerns (to
recap):

- pthread_t is reused by some OSes between threads so comparing thread ids
may give false matches in case we just use pthread_t as TheradIdentifier.

- Safari apparently uses WTF directly from JSC and changing binary interface
and especially subtle protocol details will likely break nightly builds.
Optimally, someone with visibility into both codebases could fix this with
more confidence. Alternatively, perhaps such services as threading could be
provided by the embedder via WebKit API rather then implemented in WTF -
since embedders need access to the same time/thread services as the rest of
WebKit.

Dmitry
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20091029/06e34fa6/attachment.html>


More information about the webkit-dev mailing list