comp.lang.ada
 help / color / mirror / Atom feed
From: evangeli <evangeli@cnam.fr>
Subject: Re: multithreading with gtkada
Date: Fri, 15 Nov 2002 17:25:42 +0100
Date: 2002-11-15T15:21:10+00:00	[thread overview]
Message-ID: <3DD52006.8070308@cnam.fr> (raw)
In-Reply-To: 3DD3E478.8000407@cogeco.ca

thanks for your response
i used protected type to prevent two tasks from making gtk calls at the 
same time but that doesn't seem to work

any idea?


Warren W. Gay VE3WWG wrote:

> evangeli wrote:
> 
>> hi all
>>
>> it seems that gtk doesnt support multi-threading (see 
>> http://www.faqs.org/faqs/x-faq/part7/section-15.html).
> 
> 
> I believe that Gtk does support tasks, but on UNIX platforms,
> Gtk will make use of the Xlib (as the ref above shows). This
> library I believe is now thread safe on _some_ platforms,
> but most certainly NOT on all of them.  I would certainly
> not depend upon it for portable code.
> 
>> My problem is the following :
>> my app opens a windows, which on the show event launch a task wich 
>> makes a long computation. The window also contains a cancel button 
>> which can be pressed to abort this task.The problem is that i would 
>> like this task to make X-Call, and that is apparently not possible and 
>> give me unavoidably the following error message:
>> ----------------------------------------------
>> Xlib: unexpected async reply (sequence 0x9fe)!
>> ----------------------------------------------
>> i havent found any solution which doesn't use several tasks.
>>
>> 1) Am i clear?
>> 2) Do u have any idea of a different way to do that?
>> 3) why this cruel destiny?
>>
>> thanks for any response
> 
> 
> Your problem requires some careful Ada programming. You will need
> to segment your application so that one or the following
> approaches are used:
> 
>  - Only one task does Gtk (GUI) operations
> 
> or
> 
>  - You use an Ada technique to make certain that only one Ada task
>    is doing a Gtk operation at any given instance (protected objects
>    perhaps).
> 
> Sounds like you need the second approach. You can run into the same
> situations when trying to use curses (text mode screens).
> 




  reply	other threads:[~2002-11-15 16:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-14 16:59 multithreading with gtkada evangeli
2002-11-14 17:59 ` Warren W. Gay VE3WWG
2002-11-15 16:25   ` evangeli [this message]
2002-11-15 16:08     ` Preben Randhol
2002-11-15 16:22     ` Jean-Pierre Rosen
2002-11-14 18:41 ` David Marceau
2002-11-14 22:00 ` Preben Randhol
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox