[webkit-dev] Multithread issue

Dmitry Titov dimich at chromium.org
Wed May 27 12:23:57 PDT 2009


WebKit uses thread-specific data in quite a few cases so objects in general
expect to be created, used and destroyed on the same thread. One of such
examples are timers, frequently used as deferred tasks. Creating a view and
loading a url into it likely creates one or more of such timers whihc are
stored in thread-specific list. So the code verifies that we are still
accessing the thread-specific list on the same thread on which we were
creating the timer.

Can you create view on the same thread where gtk_main is called?

Dmitry


On Wed, May 27, 2009 at 5:17 AM, Matt Bockt <bocktmatt at gmail.com> wrote:

> Hi everybody,
>
> I'm new to WebKit and I'm developing a C++ application that uses the WebKit
> browser.
>
> It runs on Fedora10, kernel 2.6.27.5-117.fc10.i686.
> The WebKit version I'm using is the r44111.
>
> Here is my problem : I'm creating a new web view in the main thread, say,
> thread A.
> The webview is then attached to a gtk_window as it's made in the
> GtkLauncher exemple.
>
> Then webkit_web_view_load_uri() is called, always in thread A.
>
> Finally, the gtk_main() function is called in another thread, say thread B.
>
> And it crashes  with the following trace  :
>
> ASSERTION FAILED: m_thread == currentThread()
> (WebCore/platform/Timer.cpp:206 bool WebCore::TimerBase::isActive() const)
>
> I experience this problem with the webkit r44111 and r43808, but not with
> r38297.
>
> I noticed that there must have been a modification in the thread management
> between the builds r38297 and r43808 since g_threads must be initialized.
> But I can't figure out why it doesn't work.
>
> Any suggestions or specific rules to follow about multi-threading, gtk and
> webkit ?
>
> Thank you for your help.
>
> --
> matt
>
> _______________________________________________
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
> http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20090527/cb980190/attachment.html>


More information about the webkit-dev mailing list