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: g2news2.google.com!news1.google.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!cyclone1.gnilink.net!spamkiller.gnilink.net!gnilink.net!nwrddc01.gnilink.net.POSTED!72fcb693!not-for-mail From: Fionn Mac Cumhaill Newsgroups: comp.lang.ada Subject: Re: Need info about Ada tasks Message-ID: <6vlpd4tho80qpm9vduvhggdeg3np867cvc@4ax.com> References: <1r3nd4190fqnicb4tdebo1ctt70cjetnhi@4ax.com> X-Newsreader: Forte Agent 4.2/32.1118 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Fri, 26 Sep 2008 12:46:52 GMT NNTP-Posting-Host: 71.170.53.73 X-Complaints-To: abuse@verizon.net X-Trace: nwrddc01.gnilink.net 1222433212 71.170.53.73 (Fri, 26 Sep 2008 08:46:52 EDT) NNTP-Posting-Date: Fri, 26 Sep 2008 08:46:52 EDT Xref: g2news2.google.com comp.lang.ada:7827 Date: 2008-09-26T12:46:52+00:00 List-Id: 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. > >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". > >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.