Re: Async HTTP download with Glib event loop doesn't work on windows




On Fri, Mar 10, 2017 at 4:38 PM, Emmanuele Bassi <ebassi gmail com> wrote:
Without knowing how AnyEvent works, if the handler involves threads
then calling *any* GTK+ API from different threads than the one that
called `gtk_main()` is going to blow up your application. Even if it
worked in one release, during a specific alignment of planets, or if
you placed the machines in a pentacle drawn in goat blood, there's no
guarantee that it'll keep working. GTK+ simply does *not* support
multi-threaded access of the windowing system resources.


It does not do anything like that. It only uses Glib::Timeout, Glib::IO, Glib::Idle watchers in fairly standard ways.
 
GTK+ and the G* platform has a whole bunch of API to deal with these
cases, like GTask[0]. Sadly, it's not very Perlish because nobody
wrote introspection overrides for it. Additionally, for things like
HTTP requests, there's a whole library called libsoup[1] which
integrates with the GLib main loop.


We're considering libsoup, but it depends on Glib::Object::Introspection for which there are no windows builds (that we know of).
 
Ciao,
 Emmanuele.


thanks,
Peter



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]