2010/10/7 Robert Norris <rw_nor...@hotmail.com>:
>
>>
>> 2010/9/15 Robert Norris :
>>> I believe the best way would be a mutex in the struct _VikViewport which 
>>> could then control the access to gdk_draw_pixbuf inside the 
>>> vik_viewport_draw_pixbuf function.
>>> Maybe I'll do that too....
>>
>> I spend some time to look at multithread aspect of viking. My limited
>> skills (in viking internals and GTK/thread model) make me suspicious
>> about many code part.
>>
>> I understood that Gtk signals are thread-safe as they are "executed"
>> in the main thread (the one running mainloop).
>> So, I think most of the background.c code can be refactored to use
>> signals instead of gtk lock.
>> Why? Currently, all downloader threads regularly locks mainthread (and
>> other threads) simply to refresh the progress view.
>> IMHO, some signals can be much better as the UI aspect will be managed
>> by a single thread: the main one. This is mostly possible here because
>> information to exchange between downloader and UI is really simple.
>
> I don't know, it mostly works so why bother changing it?

I have the feeling that we can improve both UI reactivness and tile downloading.

> A good reference:
> http://library.gnome.org/devel/gtk-faq/stable/x481.html
>
> ATM downloader threads naturally run out side of the GTK lock, thus 'signals' 
> from these threads in glib need to call gdk_threads_enter() before doing gtk 
> stuff.

What I understood is that gobject-signal is treated by
mainloop-thread. I also understood that the callback should use
gdk_threads_enter/leave, but only the main thread will be locked, not
download threads.

-- 
Guilhem BONNEFILLE
-=- JID: gu...@im.apinc.org MSN: guilhem_bonnefi...@hotmail.com
-=- mailto:guilhem.bonnefi...@gmail.com
-=- http://nathguil.free.fr/

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
Viking-devel mailing list
Viking-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/viking-devel
Viking home page: http://viking.sf.net/

Reply via email to