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-Thread: 103376,ce290b2dd8bc80e8 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!amsnews11.chello.com!nuzba.szn.dk!news.jacob-sparre.dk!pnx.dk!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Need info about Ada tasks Date: Sat, 27 Sep 2008 00:56:59 -0500 Organization: Jacob's private Usenet server Message-ID: References: <1r3nd4190fqnicb4tdebo1ctt70cjetnhi@4ax.com> <6vlpd4tho80qpm9vduvhggdeg3np867cvc@4ax.com> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: jacob-sparre.dk 1222495056 17576 69.95.181.76 (27 Sep 2008 05:57:36 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Sat, 27 Sep 2008 05:57:36 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5512 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 Xref: g2news1.google.com comp.lang.ada:2101 Date: 2008-09-27T00:56:59-05:00 List-Id: "Fionn Mac Cumhaill" wrote in message news:6vlpd4tho80qpm9vduvhggdeg3np867cvc@4ax.com... > On Fri, 26 Sep 2008 06:21:54 -0400, Stephen Leake > wrote: > >>Fionn Mac Cumhaill writes: >> >>> I am using the MingW Ada compiler and the GWindows packages on Windows >>> XP. >>> >>> I am writing a simple program which observes a table in SQL Server >>> 2000 and lists its rows to a visible screen display. I need a simple >>> task structure that can update the display periodically, with a >>> specified wait time between updates. I need to be able to abort the >>> display task at any time when the display is not being updated. >> >>Mixing tasking and GUI events can be problematic; only one thread >>can call GUI functions. That's not quite true, in that it's possible to use a binding that allows multi-task access. Claw was designed to do that (it ensures that Windows is happy by decoupling the underlying calls from your tasks). We indeed have several examples that do pretty much what you are trying to do here (having multiple tasks writing at once to different windows). >>The canonical solution to your problem is to use a Win32 timer, and >>update the display in the timer event handler function. >> >>Then "abort the display task" becomes "disable the timer". If you're comfortable with writing event handlers, that works. But it also serializes everything. >>Although Dmitry solved your immediate problem, it might be better to >>use a different example problem to study tasking. > > Mixing tasking and GUI events does indeed cause problems. The very > first subroutine call in the task object which can cause a Gui event > does not return when called. It probably would work fine with Claw. That what happens when you use a cheap knock-off like GWindows. ;-) Randy.