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,126ce244c524526b X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!wns14feed!worldnet.att.net!attbi_s22.POSTED!53ab2750!not-for-mail From: "Jeffrey R. Carter" User-Agent: Thunderbird 1.5.0.12 (Windows/20070509) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Tasking issues References: <1186851804.567302.223160@q4g2000prc.googlegroups.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: NNTP-Posting-Host: 12.201.97.213 X-Complaints-To: abuse@mchsi.com X-Trace: attbi_s22 1186956461 12.201.97.213 (Sun, 12 Aug 2007 22:07:41 GMT) NNTP-Posting-Date: Sun, 12 Aug 2007 22:07:41 GMT Organization: AT&T ASP.att.net Date: Sun, 12 Aug 2007 22:07:41 GMT Xref: g2news2.google.com comp.lang.ada:1417 Date: 2007-08-12T22:07:41+00:00 List-Id: anon wrote: > > continue : boolean := True ; -- task to continue running There's no guarantee that operations on this variable are atomic. You can get into pragma Atomic, bu in general, unprotected variables are not a good way for tasks to communicate. > if Name ( 1 .. 4 ) = "stop" then > continue := false ; > end if ; What happens after the following sequence of inputs: "atopofoldSmokey" "s" ? > -- do nothing! > > while continue loop > delay 0.0 ; > end loop ; > > -- abort tasks. But because get_name may be in the process of > -- obtaining data from standard_input. it may require a CR/LF > -- to be entered to fully abort the 'get_name' task. > > abort get_name ; > Put_Line ( "EOT -- get_name" ) ; > abort print_something ; > Put_Line ( "EOT -- print_something" ) ; > Put_Line ( "EOJ" ) ; This does quite a bit. Have the tasks check for the termination condition themselves, and the main procedure's SOS can be "null;" -- Jeff Carter "Sir Lancelot saves Sir Gallahad from almost certain temptation." Monty Python & the Holy Grail 69