From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,230344565f3fdda8 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-11-15 07:30:02 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!logbridge.uoregon.edu!fr.usenet-edu.net!usenet-edu.net!jussieu.fr!cnam.fr!not-for-mail From: evangeli Newsgroups: comp.lang.ada Subject: Re: multithreading with gtkada Date: Fri, 15 Nov 2002 17:25:42 +0100 Organization: Conservatoire National des Arts et Metiers Message-ID: <3DD52006.8070308@cnam.fr> References: <3DD3D67A.3060302@cnam.fr> <3DD3E478.8000407@cogeco.ca> NNTP-Posting-Host: lmi14.cnam.fr Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: kelvin.cnam.fr 1037373670 4439 163.173.228.14 (15 Nov 2002 15:21:10 GMT) X-Complaints-To: usenet@news.cnam.fr NNTP-Posting-Date: 15 Nov 2002 15:21:10 GMT User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.4) Gecko/20011126 Netscape6/6.2.1 X-Accept-Language: en-us Xref: archiver1.google.com comp.lang.ada:30942 Date: 2002-11-15T15:21:10+00:00 List-Id: 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). >