Thanks very much, Michael :)
I just now read the link you show below, I will try it.

You know that, in WebKitGtk, I can use multi processes with WebProcess,
I create some WebKitWebViews in the gtk main loop thread using
webkit_web_context_set_process_model(webkit_web_context_get_default(),WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES)
it creates WebProcess as many as WebKitWebView, but the main loop invoke these WebKitWebViews just one at the same time. It maybe a little waste of the WebProcess resources :), I want to use WebKitWebViews as a consumer in the producer-consumer model.

Thanks for your reading!


On 11/18/2014 10:43 PM, Michael Catanzaro wrote:
On Tue, 2014-11-18 at 17:31 +0800, 刘阳 wrote:
Can anyone figure me out, what should i do next, to get multithreading
use WebKitWebView objects without GUI ?
Hi,

GTK+ is not thread safe, so all GTK+ calls must always occur in the main
thread. WebKitWebView is a GtkWidget and accordingly it's only safe to
use from the main thread.

You can use other threads to perform slow operations, then schedule work
to be performed on the main thread with gdk_threads_add_idle() or
gdk_threads_add_timeout() [1].

Hope that helps,

Michael

[1]https://developer.gnome.org/gdk3/stable/gdk3-Threads.html



_______________________________________________
webkit-gtk mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-gtk

Reply via email to