[gtkada] GtkAda and tasking

Arnaud Charlet charlet at ACT-Europe.FR
Wed Apr 19 13:58:33 CEST 2000


> <<When Glib is initialized to be task-safe, GtkAda is task aware. There is a
> single global lock that you must acquire with Gdk.Threads.Enter before
> making any Gdk/Gtk call, and release with Gdk.Threads.Leave afterwards. >>
> If it is really a lock, it would mean that I cannot have one task managing
> one window, with another one managine another window. If that's the case, I
> would describe it as a "sequential" component, not a "concurrent" one...

Sure. It can't find any reference to the word concurrent in the documentation,
so I am unsure at what is unclear in the documentation. Any suggestion
to make it clearer is welcome.

> <<Beware that the GtkAda main loop (Gtk.Main.Main) can only be be run inside
> one specific tasks. In other words, you cannot call Gtk.Main.Main from a
> different task that the one that started the outer level main loop. >>
> This is what I find particularly unclear. What is the "outer level main
> loop" if it is not Gtk.Main.Main ? Moreover, I tried to initialize the
> system (Gtk.Main.Init, Gtk_New) from the main task, then call Gtk.Main.Main
> from another one. This did not seem to contradict the previous paragraph,
> but it blocked the system.

Ok, we will try to clarify this one. You can call Gtk.Main.Main several
times, as explained in the RM:

<<
This subprogram can be called recursively, to start new internal loops. Each of these loops is exited through a call to Main_Quit. This is the recommended technics to use when you want to popup a dialog and
wait for the user answer before going any further. Note that this procedure can only be called within a single task. 
>>

> > Also, if you are looking for a fully blocking solution, you should look
> for
> > a fully tasking solution I think.
> I'd love to. The question is how to do it (see my other message).

By doing Gtk calls in more than one task.

Arno





More information about the gtkada mailing list