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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,3abdc4d72c0b7e9d X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!v26g2000prm.googlegroups.com!not-for-mail From: Bender Newsgroups: comp.lang.ada Subject: Re: Running a background task Date: Thu, 15 May 2008 17:43:19 -0700 (PDT) Organization: http://groups.google.com Message-ID: <62f65249-ace3-44fb-9760-976168856c1e@v26g2000prm.googlegroups.com> References: <760f4092-577e-440e-9fef-fb3ff3389560@h1g2000prh.googlegroups.com> NNTP-Posting-Host: 76.25.96.235 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1210898599 19465 127.0.0.1 (16 May 2008 00:43:19 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 16 May 2008 00:43:19 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: v26g2000prm.googlegroups.com; posting-host=76.25.96.235; posting-account=znprRwoAAABc0sBerLGAFs7TqvGvhALp User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:87 Date: 2008-05-15T17:43:19-07:00 List-Id: On May 15, 4:31 pm, Adam Beneschan wrote: > When Handle_Msg calls on the On_String entry, this starts a > rendezvous, and Handle_Msg stops when the rendezvous is done. Since > the "accept" has a "do" part, the rendezvous will not be done until > the "do" completes, which in your case never happens. Thus, > Handle_Msg will never proceed past the entry call. > > It's hard for me to give a solution, since I don't know just what > you're trying to accomplish; but you may want to move the loop out of > the "accept". > > -- Adam I need to poll the device every 3 seconds. If I move the loop outside of the accept, won't it just call Send_Status_Req procedure one time, then finish the task? Surely there must be a mechanism similar to C's pthread that allows me to start a thread and let it worry about itself, while the main thread continues processing. All I'm seeing here is that the task is run in parallel to the other code in the Handle_Msg procedure. I wan't that procedure to finish up, and let the rest of the program continue to run, all with Poll_For_Status running in the background.